토픽 구독
Last updated
Last updated
POST
https://api.mint-app.com/v1/topic/subscribe
사용자 아이디는 반드시 MintApp.setUser 이후에 api를 사용해야한다.
Name | Type | Description |
---|---|---|
{
"result": "success",
"data": "https://push-link.domain.com/12345"
"message" : "인증번호를 전송하였습니다."
}
{
"result": "failed",
"reason": "유효하지 않은 키값입니다."
}
{
"result": "failed",
"reason": "존재하지 않는 사용자입니다."
}
curl --location --request POST 'https/api.mint-app.com/v1/topic/subscribe' \
--header 'Accept: application/json' \
--header 'api-key: {api-key}' \
--header 'api-secret: {api-secret}' \
--form 'user_id="3"' \
--form 'type="gender_male"'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https:/api.mint-app.com/v1/topic/subscribe',
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' => '3','type' => 'gender_male'),
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","3")
.addFormDataPart("type","gender_male")
.build();
Request request = new Request.Builder()
.url("https:/api.mint-app.com/v1/topic/subscribe")
.method("POST", body)
.addHeader("Accept", "application/json")
.addHeader("api-key", "{api-key}")
.addHeader("api-secret", "{api-secret}")
.build();
Response response = client.newCall(request).execute();
user_id
string
로그인한 사용자의 아이디
type
string
민트앱에서 생성된 토픽 종류