# API Variables

## **Request Variables**

You need to use below variables to construct a PUSH API

### Request URL (V3)

Method : **`POST`**

```
https://pickyassist.com/app/api/v2/push
```

### Request URL (V4)

Method : **`POST`**

```
https://app.pickyassist.com/api/v2/push
```

| **Variable**               | **Date Type** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | **Required**                                                                                |
| -------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| token                      | alphanumeric  | Unique token for the project                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Mandatory                                                                                   |
| application                | numeric       | <p>Through which application the message need to sent.<br><br>121 = WhatsApp Business API </p><p>5 = Facebook Messenger<br>101 = WhatsApp Cloud API<br><br><strong>If you have connected multiple channels or using WhatsApp Cloud api then please get the channel id from your project under Settings -></strong> <a href="https://app.pickyassist.com/settings/channels">Channels </a></p><p></p>                                                                                                                                                                    | Mandatory                                                                                   |
| voice                      | numeric       | 1 = Send the audio file as Voice Note in WhatsApp, supports only in WhatsApp Web Automation Channel                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Optional                                                                                    |
| globalmessage              | text          | <p>Global Message Text Message with emoji supported by whatsapp</p><p>If you are sending image and video you can pass caption text here</p>                                                                                                                                                                                                                                                                                                                                                                                                                            | Mandatory only if message variable is empty                                                 |
| template\_globalmessage    | array         | <p>This is used for sending templated messages in WhatsApp Official account, need to pass the dynamic variable value in array</p><p></p><p>template\_message</p>                                                                                                                                                                                                                                                                                                                                                                                                       | Optional                                                                                    |
| template\_id               | string        | Template unique id used for sending WhatsApp Official Templated Message                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | Mandatory only if sending WhatsApp Official template messages                               |
| language                   | string        | Language of the WhatsApp Official Template                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Mandatory only if sending WhatsApp Official template messages                               |
| template\_header           | string        | Header for sending WhatsApp Official Template , applicable only for sending documents (only pdf supports now)                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Optional                                                                                    |
| globalmedia                | URL           | URL from we need to fetch the media , Maximum Size is 50 MB                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Optional                                                                                    |
| globalmedia\_code          | string        | Sending Global Media files as base64                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Optional                                                                                    |
| media\_code                | string        | Sending personalised media file as base64, works only with WhatsApp Official & Shared Number                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Optional                                                                                    |
| sticker                    | numeric       | <p>1</p><p></p><p>sticker=1 for sending stickers, supports only in WhatsApp Official & WhatsApp Web Automation. <a href="sending-stickers">Read More</a></p>                                                                                                                                                                                                                                                                                                                                                                                                           | Optional                                                                                    |
| priority                   | numeric       | <p>0 = Low<br>1 = High</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Optional, default is 0                                                                      |
| createcontact              | numeric       | 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Optional , if passed 1 then it will create a new contact against the channel                |
| action                     | numeric       | 1 = [WhatsApp Filter ](https://help.pickyassist.com/api-documentation-v2/push-api/broken-reference)                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Optional                                                                                    |
| location                   | Array         | <p>Location values need to pass as array</p><p><br>name = name of the location<br>address = Address of the Location</p><p>lat =  Latitude<br>long = Longitude  </p><p></p><p><strong>Not Supported in Phone Automation</strong> </p>                                                                                                                                                                                                                                                                                                                                   | Optional                                                                                    |
| contact                    | Array         | <p>Contact as Array, in case multiple contact shared then same will be passed as multiple array's</p><p></p><p>first\_name = First Name</p><p>last\_name = Last Name</p><p>phone = Phone Number</p><p>city = City</p><p>country = Country<br>country\_code = Country Short Code</p><p>state = State</p><p>street = Street<br>address\_type = Address Type</p><p>zip = Postal Code</p><p>email = Email Address </p><p>company = Company Name<br>contact\_image = Base 64 code of the contact image</p><p></p><p><strong>Not Supported in Phone Automation</strong> </p> | Optional                                                                                    |
| data                       | Array         | Object through which you can pass multiple number and its personalised message                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | Mandatory                                                                                   |
| number                     | numeric       | <p>Mobile Number with full country code without 0 or +</p><p>+55 12345 6789 – <del>Wrong Format</del></p><p>55123456789 – Correct Format</p>                                                                                                                                                                                                                                                                                                                                                                                                                           | Mandatory, minimum 5 length                                                                 |
| messenger\_id              | numeric       | Unique User ID allocated by the Facebook.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Mandatory if application=5 i.e Facebook                                                     |
| message                    | string        | Text Message with emoji supported by whatsapp If you are sending image and video you can pass caption text also here. Caption text is not supported for PDF, Audio, Document                                                                                                                                                                                                                                                                                                                                                                                           | Mandatory only if globalmessage variable is empty                                           |
| reference\_number          | string        | <p>You can pass any value here like your internal message id etc and the same will be returned in the Event Webhook i.e Delivery Reports </p><p></p><p>Please note we don't check for duplicate or unique values here, we just return the value you passed</p>                                                                                                                                                                                                                                                                                                         | Optional                                                                                    |
| quoted                     | numeric       | Used to send quoted replies in WhatsApp Official & WhatsApp Web Automation. [Read More](https://help.pickyassist.com/api-documentation-v2/webhook/getting-the-conversation-context)                                                                                                                                                                                                                                                                                                                                                                                    | Optional                                                                                    |
| template\_message          | array         | This field needs to be used for sending WhatsApp Official Template message, you need to pass the dynamic variable data as array                                                                                                                                                                                                                                                                                                                                                                                                                                        | Mandatory only if sending WhatsApp Official template messages                               |
| payload                    | array         | <p>You can pass a custom payload like a reference number for each button in the quick replies, this is an array and optional </p><p></p><p>This payload will return in the <a href="../webhook/getting-the-conversation-context">Webhook</a> when the user click on the button</p>                                                                                                                                                                                                                                                                                     | Optional                                                                                    |
| interactive\_globalbuttons | array         | <p>This is applicable only for the Call to Action URL and used for sending dynamic variables that should be replaced in the dynamic URL button. Mandatory if button type is url and interactive\_buttons is empty.</p><p></p><p>If the URL variable is dynamic in nature (personalise for each number) then you need to pass the dynamic value against each number through <strong>interactive\_buttons</strong></p>                                                                                                                                                   | Optional                                                                                    |
| interactive\_buttons       | array         | <p>This is applicable only for the Call to Action URL and used for sending dynamic variables that should be replaced in the dynamic URL button.<br></p><p>This is used to pass personalised variable for each number dynamically and this is optional if interactive\_globalbuttons is not empty</p>                                                                                                                                                                                                                                                                   | <p>this is optional if <strong>interactive\_globalbuttons</strong> is not empty </p><p></p> |
|                            |               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                                                                                             |

####

## **Response Variables**&#x20;

All API request will get the response&#x20;

{% hint style="info" %}
Please note **“100 -> Sucess”** response doesn’t mean the message has been successfully sent to the user, it means your message has been accepted by our servers and pushed to your phone for processing.
{% endhint %}

| **Variable** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| status       | <p><strong>100=>’Success’,</strong><br>401=>’Authentication Failed’,<br>402=>’Empty Number List’,<br>403=>’Insufficient Balance’,<br>404=>’Unable to Communicate with Your  Phone ! ‘,<br>405=>’API Is Not Active For This Plan’,<br>406=>’Invalid Mobile Number’,<br>407=>’Message cannot be empty’,<br>408=>’Project is not Active’,<br>409=>’Invalid User’</p><p>410=>'Invalid Request'</p><p></p><p><a href="../references/status-and-error-codes">Refer Complete Status & Error Code Here</a></p> |
| push\_id     | Push id generated by Picky Assist Server (for your reference)                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| message      | Detailed Status Message (description of any error message)                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| data         | Array which contacts below details                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| msg\_id      | Unique Message Id allocated to each number                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| number       | Mobile Number in which the message is sent                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| credit       | Credit / billing value used for sending the message out                                                                                                                                                                                                                                                                                                                                                                                                                                                |
