민트앱
  • 안녕하세요
  • 시작하기
    • 1.프로젝트 생성
    • 2.프로젝트 설정
    • 3.스토어 정보
    • 4.고객요청
  • 민트앱의 특징
  • 민트앱 사용법
    • 0.콘솔 출력(디버깅)
    • 1.프로젝트 시작하기
    • 2.앱 테스트하기
      • ios
      • 안드로이드
    • 연장하기
    • 결제 방법
    • 유지보수
  • Code
    • user-agent
    • frame
    • html
    • javascript
    • 애니스포츠 javascript
    • nawiz javascript
  • Push API
    • 인증
    • 개인 전송
    • 그룹전송(JSON)
    • 그룹전송(CSV)
    • 토픽전송
  • Data API
    • 토픽 CRUD
    • 인증
    • 딥링크 생성
    • 토픽 구독
    • 토픽 구독 해제
    • 전체 토픽 구독 해제
  • 딥링크
    • firebase dynamic 딥링크
    • URI Scheme 딥링크
  • 소셜로그인
    • 애플로 로그인
    • 소셜로그인 사용법
    • 구글 로그인 설정
    • 카카오 로그인 설정
    • 네이버 로그인
    • 페이스북 로그인
  • 토픽
  • 카테고리
    • ios
    • 안드로이드
  • Conents
    • Release Note
    • 이용약관
    • 개인정보처리방침
  • 파일
    • 스플래쉬 mp4,gif,lottie
    • 스플래쉬
    • 앱아이콘
    • 애플 스크린샷 샘플
    • 안드로이드 스크린샷 샘플
    • 스크린샷 샘플
  • 스플래쉬 동작원리
  • 공지사항
  • 플러그인
    • 그누보드 매뉴얼
  • 상담
  • 인증서
Powered by GitBook
On this page
  • 그룹전송
  • sample

Was this helpful?

  1. Push API

그룹전송(JSON)

json 으로 생성된 여러사용자에게 전송

그룹전송

POST https://push.mint-app.com/v1/push/group/json

여러사람에게 푸쉬를 전송하기 위한 api 입니다 header에 인증 정보를 꼭 넣어주세요.

Request Body

Name
Type
Description

reserved_date

string

예약 시간(yyyy-MM-dd hh:mm:ss) 형식

title

string

푸쉬의 간단한 제목(실제로 전송되지는 않음)

message

array

push json array

{
    "result": "success",
    "data": {
        "send_count": 2
    }
}
{
    "result": "failed",
    "reason": "잘못된 JSON 형식입니다."
}
{
    "result": "failed",
    "reason": "유효하지 않은 키값입니다."
}
{
    "result": "failed",
    "reason": "존재하지 않는 사용자입니다."
}

message 형식

[
  {
    "user_id":"user_id",
    "title":"title",
    "body":"body",
    "badge":1,
    "image_url":"https://img.domain.com/image.jpg",
    "url":"https://domain.com/index.php"
  }
]
  • 세부 파라미터는 개인송과 동일하지만 image_file은 사용할수 없다. image_url을 생성해서 전송해야된다.

  • 사용자 아이디는 중복해서 사용할수 없다.

sample

curl --location --request POST 'https://push.mint-app.com/v1/push/group/json' \
--header 'Accept: application/json' \
--header 'api-key: {api-key}' \
--header 'api-secret: {api-sercret}' \
--form 'title="test 메시지"' \
--form 'reserved_date="2021-09-01 12:00:00"' \
--form '=@"/path/to/file"' \
--form 'message="[
  {
    \"user_id\":\"1\",
    \"title\":\"title\",
    \"body\":\"body\",
    \"badge\":1,
    \"image_url\":\"https://img.domain.com/image.jpg\",
    \"url\":\"https://domain.com/index.php\"
  }
]"'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://push.mint-app.com/v1/push/group/json',
  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('title' => 'test 메시지','reserved_date' => '2021-09-01 12:00:00',''=> new CURLFILE('/path/to/file'),'message' => '[
  {
    "user_id":"1",
    "title":"title",
    "body":"body",
    "badge":1,
    "image_url":"https://img.domain.com/image.jpg",
    "url":"https://domain.com/index.php"
  }
]'),
  CURLOPT_HTTPHEADER => array(
    'Accept: application/json',
    'api-key: {api-key}',
    'api-secret: {api-sercret}'
  ),
));

$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("title","test 메시지")
  .addFormDataPart("reserved_date","2021-09-01 12:00:00")
  .addFormDataPart("","file",
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File("/path/to/file")))
  .addFormDataPart("message","[
  {
    \"user_id\":\"1\",
    \"title\":\"title\",
    \"body\":\"body\",
    \"badge\":1,
    \"image_url\":\"https://img.domain.com/image.jpg\",
    \"url\":\"https://domain.com/index.php\"
  }
]")
  .build();
Request request = new Request.Builder()
  .url("https://push.mint-app.com/v1/push/group/json")
  .method("POST", body)
  .addHeader("Accept", "application/json")
  .addHeader("api-key", "{api-key}")
  .addHeader("api-secret", "{api-secret}")
  .build();
Response response = client.newCall(request).execute();
Previous개인 전송Next그룹전송(CSV)

Last updated 3 years ago

Was this helpful?