LANYINGDevelopers
Web & Mini ProgramiOSAndroidC++Server API

7 Push interface#

7.1 Get push certificate#

GET /push/certificate

Request Header#

ParameterData TypeRequiredDescription
access-tokenstringfalseToken
app_idstringtrueApp ID
group_idint64falseThis field can be set only if access-token is an Admin token, means call this interface as an Admin for this group ID
user_idint64falseThis field can be set only if access-token is a user token, means call this interface as a group member for this user ID

Query Param#

ParameterData TypeRequiredDescription
environmentint32falseRun environment, 0 - development environment, 1 - production environment, default: 1
providerint32trueCertificate provider, 1-APNS,2-Huawei,3-Xiaomi,4-Meizu,5-VIVO, 6-OPPO, 7-FCM

Response Body#

● 200 Response data format:JSON

ParameterTypeDescription
codeint32Response code; 200 indicates success
dataobjectResult data
⇥ app_idstringAPP ID
⇥ app_keystringAPP KEY
⇥ app_secretstringAPP SECRET
⇥ certificatestringCertificate
⇥ namestringCertificate name
messagestringError information, null means success

Interface Description#

7.2 Send push notification#

POST /push/notify

Request Header#

ParameterData TypeRequiredDescription
access-tokenstringfalseToken
app_idstringtrueApp ID
group_idint64falseThis field can be set only if access-token is an Admin token, means call this interface as an Admin for this group ID
user_idint64falseThis field can be set only if access-token is a user token, means call this interface as a group member for this user ID

Request Body#

ParameterData TypeRequiredDefaultDescription
audienceobjectfalseTarget of push, cannot be blank. Type is string or JSONObject:
"all", means push to all devices
{"tag":["tag1","tag2"]} means push to devices labeled tag1 or tag2
{"alias":["alias1","alias2"]} means push to devices with alias1 or alias2
{"user_id":[111,222]} means push to devices with user ID 111 or 222
{"push_token":["push_token1","push_token2"]} means push to devices with PushToken push_token1 or push_token2
List length cannot exceed 500 when pushed with tag/alias/user ID/pushToken
settingobjectfalsePush settings, can be blank
⇥ request_idstringfalseRequest ID for request deduplication, not pushed if request ID has been present before. Can be blank, which means no deduplication.
⇥ distribution_strategystringfalseNotification distribution strategy: combined- means to use Lanying channel to distribute first, and if Lanying is not online, use vendor channel to distribute; Mxpush_only- indicates that only the Lanying channel is used for distribution; Ospush_only- indicates that only the vendor channel is used for distribution. Can be empty, which defaults to combined
⇥ ospush_sequencearray[string]falseVendor push priority: ups - domestic vendors (Xiaomi/Huawei/Meizu/oppo/vivo); fcm - FCM push; Huawei - Huawei push; Xiaomi - Xiaomi push; Oppo - OPPO push; Vivo - Vivo push, Meizu - Meizu push. Can be empty, which defaults to [ups, fcm]
messageobjectfalseMessage body pushed, cannot be blank
⇥ typestringfalseMessage type:text - text,image - image, cmd - pass-through message. Can be blank, which means text by default
⇥ titlestringfalseTittle, can be blank
⇥ bodystringfalseContent, can be blank
⇥ attachment_urlstringfalseAttachment address: URL address of image/audio/video, can be blank. If it is an image address, it needs to end with .jpg/jpeg/png, and the picture size should be less than 1M. 876*324 px is recommended
⇥ big_textstringfalseLarge text: If this field is set and the vendor supports pushing large text, use this field to push large text; Otherwise, use the body field to push ordinary text
⇥ badgestringfalseBadge: If it is a number, modify the badge to this number; If starts with +, means adding this number to badge, ex. “+1” means adding 1 to badge; If blank, default “+1"
⇥ extobjectfalseExtension field: Can be blank, JSONObject type, ex. {"key1":123, "key2":"value2"}
⇥ show_begin_timeint64falseStart timestamp of timed presentation (seconds), blank for immediate presentation
⇥ show_end_timeint64falseEnd timestamp of timed presentation (seconds), can be blank
⇥ iosobjectfalseAndroid extra parameter, can be blank
⇥⇥ soundstringfalseNotification alert sound, can be blank
⇥⇥ content_availablebooleanfalseCorresponding to content-available in APNs, can be blank
⇥⇥ mutable_contentbooleanfalseCorresponding to mutable-content in APNs, can be blank
⇥⇥ categorystringfalseCorresponding to category in APNs Payload, can be blank
⇥⇥ thread_idstringfalseCorresponding to thread-id in APNs, can be blank; which is used for grouping notifications by thread-id
⇥⇥ subtitlestringfalseSubtitle corresponding to APNs, can be empty
⇥⇥ apns_collapse_idstringfalseapns-collapse-id corresponding to APNs, can be empty. The notifications with apns-collapse-id parameter will override other notifications with the same apns-collapse-id in the Notification Center.
⇥ androidobjectfalseios extra parameter, can be blank
⇥⇥ soundstringfalseMessage alert sound, can be blank
⇥⇥ channel_idstringfalseNotification bar channel, can be blank
⇥⇥ click_actionstringfalseWhat to do after notification clicked: intent to open a specific page; open_app to open App homepage. Can be blank.
⇥⇥ intentstringfalseClick notification to open a specific page: can be blank, unless click_action is intent. Ex. intent:#Intent;component= package name/activity full path; S.parm1=value1;S.parm2=value2;end
⇥ huaweiobjectfalsehuawei vendor extra parameter
⇥⇥ soundstringfalseMessage alert sound, can be blank
⇥⇥ channel_idstringfalseNotification bar channel, can be blank
⇥⇥ click_actionstringfalseWhat to do after notification clicked: intent to open a specific page; open_app to open App homepage. Can be blank.
⇥⇥ intentstringfalseClick notification to open a specific page: can be blank, unless click_action is intent. Ex. intent:#Intent;component= package name/activity full path; S.parm1=value1;S.parm2=value2;end
⇥⇥ badge_classstringfalseThe application entry Activity class corresponding to the desktop icon, such as com.test.badge.MainActivity, which can be blank
⇥ xiaomiobjectfalsexiaomi vendor extra parameter
⇥⇥ soundstringfalseMessage alert sound, can be blank
⇥⇥ channel_idstringfalseNotification bar channel, can be blank
⇥⇥ click_actionstringfalseWhat to do after notification clicked: intent to open a specific page; open_app to open App homepage. Can be blank.
⇥⇥ intentstringfalseClick notification to open a specific page: can be blank, unless click_action is intent. Ex. intent:#Intent;component= package name/activity full path; S.parm1=value1;S.parm2=value2;end
⇥ oppoobjectfalseoppo vendor extra parameter
⇥⇥ soundstringfalseMessage alert sound, can be blank
⇥⇥ channel_idstringfalseNotification bar channel, can be blank
⇥⇥ click_actionstringfalseWhat to do after notification clicked: intent to open a specific page; open_app to open App homepage. Can be blank.
⇥⇥ intentstringfalseClick notification to open a specific page: can be blank, unless click_action is intent. Ex. intent:#Intent;component= package name/activity full path; S.parm1=value1;S.parm2=value2;end
⇥ vivoobjectfalsevivo vendor extra parameter
⇥⇥ soundstringfalseMessage alert sound, can be blank
⇥⇥ channel_idstringfalseNotification bar channel, can be blank
⇥⇥ click_actionstringfalseWhat to do after notification clicked: intent to open a specific page; open_app to open App homepage. Can be blank.
⇥⇥ intentstringfalseClick notification to open a specific page: can be blank, unless click_action is intent. Ex. intent:#Intent;component= package name/activity full path; S.parm1=value1;S.parm2=value2;end
⇥⇥ push_modeint32falsePush mode: 0 - production push; 1 - testing push. Default 0
⇥⇥ classificationint32falseMessage type: 0 - operational message; 1 - system message. Default 0
⇥ flymeobjectfalsemeizu vendor extra parameter
⇥⇥ soundstringfalseMessage alert sound, can be blank
⇥⇥ channel_idstringfalseNotification bar channel, can be blank
⇥⇥ click_actionstringfalseWhat to do after notification clicked: intent to open a specific page; open_app to open App homepage. Can be blank.
⇥⇥ intentstringfalseClick notification to open a specific page: can be blank, unless click_action is intent. Ex. intent:#Intent;component= package name/activity full path; S.parm1=value1;S.parm2=value2;end
⇥ fcmobjectfalsefcm vendor extra parameter
⇥⇥ soundstringfalseMessage alert sound, can be blank
⇥⇥ channel_idstringfalseNotification bar channel, can be blank
⇥⇥ click_actionstringfalseWhat to do after notification clicked: intent to open a specific page; open_app to open App homepage. Can be blank.
⇥⇥ intentstringfalseClick notification to open a specific page: can be blank, unless click_action is intent. Ex. intent:#Intent;component= package name/activity full path; S.parm1=value1;S.parm2=value2;end
⇥ honorobjectfalseAdditional Honor vendor parameters
⇥⇥ soundstringfalseMessage alert sound, can be blank
⇥⇥ channel_idstringfalseNotification bar channel, can be blank
⇥⇥ click_actionstringfalseWhat to do after notification clicked: intent to open a specific page; open_app to open App homepage. Can be blank.
⇥⇥ intentstringfalseClick notification to open a specific page: can be blank, unless click_action is intent. Ex. intent:#Intent;component= package name/activity full path; S.parm1=value1;S.parm2=value2;end
⇥⇥ badge_classstringfalseThe application entry Activity class corresponding to the desktop icon, such as com.test.badge.MainActivity, which can be blank

Response Body#

● 200 Response data format:JSON

ParameterTypeDescription
codeint32Response code; 200 indicates success
dataobjectResult data
⇥ task_idint64Task ID
messagestringError information, null means success

Interface Description#

7.3 Query push stats#

POST /push/task/detail

Request Header#

ParameterData TypeRequiredDescription
access-tokenstringfalseToken
app_idstringtrueApp ID
group_idint64falseThis field can be set only if access-token is an Admin token, means call this interface as an Admin for this group ID
user_idint64falseThis field can be set only if access-token is a user token, means call this interface as a group member for this user ID

Request Body#

ParameterData TypeRequiredDefaultDescription
listarray[int64]trueList of task IDs

Response Body#

● 200 Response data format:JSON

ParameterTypeDescription
codeint32Response code; 200 indicates success
dataarray[object]Result data
⇥ apns_receivedint64Delivery number on APNs channel
⇥ apns_sentint64Sent number on APNs channel
⇥ apns_targetint64Valid target number on APNs channel
⇥ fcm_receivedint64Delivery number on FCM channel
⇥ fcm_sentint64Sent number on FCM channel
⇥ fcm_targetint64Valid target number on FCM channel
⇥ flyme_receivedint64Delivery number on Meizu channel
⇥ flyme_sentint64Sent number on Meizu channel
⇥ flyme_targetint64Valid target number on Meizu channel
⇥ honor_receivedint64Number delivered through the Honor channel
⇥ honor_sentint64Number sent through the Honor channel
⇥ honor_targetint64Number of valid targets for the Honor channel
⇥ huawei_receivedint64Delivery number on Huawei channel
⇥ huawei_sentint64Sent number on Huawei channel
⇥ huawei_targetint64Valid target number on Huawei channel
⇥ mxpush_receivedint64Delivery number on Lanying channel
⇥ mxpush_sentint64Sent number on Lanying channel
⇥ mxpush_targetint64Valid target number on Lanying channel
⇥ oppo_receivedint64Delivery number on oppo channel
⇥ oppo_sentint64Sent number on oppo channel
⇥ oppo_targetint64Valid target number on oppo channel
⇥ vivo_receivedint64Delivery number on vivo channel
⇥ vivo_sentint64Sent number on vivo channel
⇥ vivo_targetint64Valid target number on vivo channel
⇥ xiaomi_receivedint64Delivery number on Xiaomi channel
⇥ xiaomi_sentint64Sent number on Xiaomi channel
⇥ xiaomi_targetint64Number of valid Xiaomi channel targets
⇥ task_idint64Push task ID
messagestringError information, null means success

Interface Description#

Generated API content with concise AI notes where context helps.