개인에게 푸쉬를 전송하기 위한 api 입니다 header에 인증 정보를 꼭 넣어주세요.
{
"result": "success",
"data": {
"success": 2,
"failed": 0
}
}
{
"result": "failed",
"reason": "유효하지 않은 키값입니다."
}
{
"result": "failed",
"reason": "존재하지 않는 사용자입니다."
}
curl --location --request POST 'https://push.mint-app.com/v1/push/user' \
--header 'Accept: application/json' \
--header 'api-key: {api-key}' \
--header 'api-secret: {api-secret}' \
--form 'user_id="1"' \
--form 'title="title"' \
--form 'body="body"' \
--form 'push_type="new or main"' \
--form 'url="https://www.domain.com"'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://push.mint-app.com/v1/push/user',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('user_id' => '1','title' => 'title','body' => 'body','url' => 'https://www.domain.com','push_type' => 'new or main'),
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'api-key: {api-key}',
'api-secret: {api-secret}',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_id","1")
.addFormDataPart("title","title")
.addFormDataPart("body","body")
.addFormDataPart("push_type","new or main")
.addFormDataPart("url","https://www.domain.com")
.build();
Request request = new Request.Builder()
.url("https://push.mint-app.com/v1/push/user")
.method("POST", body)
.addHeader("Accept", "application/json")
.addHeader("api-key", "a4645610-4270-4a80-a6be-797f5d846158")
.addHeader("api-secret", "4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a")
.build();
Response response = client.newCall(request).execute();