Docs

Attach push token to SIP number

https://api.apifonica.com/v2/numbers/{numberSID}/token

Overview

To attach a push token to SIP number you need to make a POST request to /numbers/{numberSID}/token

Please notice that this request must be executed under authorization of the number! You can find the numberSID and number token in the details of the sip number.

You can attach several tokens to one number: one token for every device.

The table below lists parameters specified while making this request.

Parameter

Required?

Description

Default

number

yes

SIP number to which you want to attach push token.

N/A

push_token

yes

Unique token which is needed to send push notifications to your application.

N/A

device_type

yes

Type of device. Can be “android” or “ios”.

N/A

Required

yes

Description

SIP number to which you want to attach push token.

Default value

N/A

Required

yes

Description

Unique token which is needed to send push notifications to your application.

Default value

N/A

Required

yes

Description

Type of device. Can be “android” or “ios”.

Default value

N/A

Request example

curl –X POST ‘https://api.apifonica.com/v2/numbers/{numberSID}/token’ \
-H ‘Content-Type: application/json’ \
-d ‘{ \
     “number”: “883140347007961”
     “push_token”: ”{pushToken}”, \
     “device_type”: “android” \
    }’ \
-u {number_sid}:{token}

Response example

{
    "sid": "tokb35c6422-dcc8-3255-8b20-f94d55469175",
    "number": "883140347007961",
    "push_token": "{pushToken}",
    "device_type": "android",
    "created": "Fri, 21 Jul 2017 12:40:23 +0000",
    "updated": "Fri, 21 Jul 2017 12:40:23 +0000"
}