Webhook


Partner Webhook API allows you to determine the webhook URL callback to receive notification and updates about your partner account.

Webhooks can arrive from the following IP address:


  • 34.165.99.212


This API has 3 parts

Part 1: how to set partner webhook to get notification.

Part 2: how to see the webhook you set.

Part 3: how the data is sent to you.


Part 1: Set the webhook address

Settings:

URL

https://partners.99digital.co.il/api/settings/setWebhook

Method

JSON via POST

Header

Authorization: Bearer {{access_token}}

*The access_token can be received from settings->get access token API.


Body:

Parameter

Description / Example

Maximum length

Remarks

url

The webhook URL. must start with HTTPS / HTTP

512

Full URL here


Response:


{
"status": "OK",
"url": "your-webhook.example.com",
"reason": 1
}


Response-Explain:

Parameter

Description

status

OK or FAIL

"OK" means the request has been sent to Meta.

"Fail" means error.

url

The webhook url you provided

reason

'reason' is the status explanation in case of FAIL

1

not FAIL. the status is OK

2

wrong credentials

3

Access token does not exist or expired, please generate another one from Settings - Get access token API

13

url is invalid


Part 2: Get the webhook address


Settings:

URL

https://partners.99digital.co.il/api/settings/getWebhook

Method

JSON via GET

Header

Authorization: Bearer {{access_token}}

*The access_token can be received from settings->get access token API.


Body: nothing, leave it empty.


Response:

{
"status": "OK",
"url": "your-webhook.example.com",
"reason": 1
}


Response-Explain:

Parameter

Description

status

OK or FAIL

"OK" means the request has been sent to Meta.

"Fail" means error.

url

The webhook URL

reason

'reason' is the status explanation in case of FAIL

1

not FAIL. the status is OK

2

Wrong credentials

3

Access token does not exist or expired, please generate another one from Settings - Get access token API

13

you need to use GET method.


Part 3: How and when the webhook is sent to you

For every event that happens in the partners system, you will get a webhook.


URL

Your URL

Method

JSON via POST


Event type:


  • whatsapp - for everything that is related to WhatsApp.

  • builder - for everything to our builder system.

  • partners - for everything that is related to threshold you set in our partners portal (future event)

  • online - for everything that is related to our online. (future event)

  • package - for everything that is related to a package purchased. (future event)

Event: WhatsApp

With every whatsapp event, you will get some of the following response:


{
"status": "OK",
"event": "whatsapp",
"whatsapp": "972501234567",
"whatsapp_reference": "1234567",
"whatsapp_extra_info": 2,
"whatsapp_apiKey": "123-456-789"
}


Response-Explain:

Parameter

Description / Example

status

"OK" always

event

whatsapp

whatsapp

the whatsapp number that is relevant

whatsapp_reference

the reference value that was provided by you when creating the account

whatsapp_extra_info

Here you will see a number related to the whatsapp update

number

When will you get this webhook?

1

The client has finished the onboarding process through the link, but the account is not yet ready to start messaging at all

2

The client has finished the onboarding process through the link, and the account is ready to start receiving and replying to messages only

3

The WhatsApp account is ready to start sending templates and receiving messages. onboarding completed.

4

The WhatsApp account has been deleted

5

There was an error on the client's onboarding process. please contact your client to provide support.

daily_limit

This will show the daily business conversations limit this line can have right from the start.

options:

0

The daily messages was not determined yet. please send your first outgoing message/template and you will get a webhook with an update

250

250 daily conversations (this is usually the default when the business is not verified)

2000

2000 daily conversations (this is usually the default when the business is verified)

100000

100,000 daily conversations

1000000

If you get this number, it means unlimited.

the daily limit will only come for whatsapp_extra_info = 1 / 2 / 3

whatsapp_apiKey

The apiKey that was created for you, to use the WhatsApp V2 API.

This will be sent only when the whatsapp_extra_info is 1 / 2 / 3


The first webhook you will get after your client finishes the onboarding will be with whatsapp_extra_info 1 or 2, and it will include the whatsapp_apiKey. we recommend that you use the setWebhook API for the WhatsApp V2, in order to start getting webhooks update regarding this whatsapp account.

Event: Builder

With every Builder event, you will get some of the following response:


{
"status": "OK",
"event": "builder",
"builderID": 523,
"builder_url": "https://builderurl.com/...",
"builder_reference": "63f563",
"builder_extra_info": 1
}


Response-Explain:

Parameter

Description / Example

status

"OK" always

event

builder

builderID

The builderID of the builder

builder_url

The builder URL

builder_reference

The reference value that was provided by you when creating the builder

builder_extra_info

Here you will see a number related to the builder update

number

When will you get this webhook?

1

New builder was created

2

Builder was deleted

3

Builder user access reset was made

4

Builder Login request link was created


Event: Online

With every online omnichannel event, you will get some of the following response:


{
"status": "OK",
"event": "online",
"accountID": 523,
"agentID": 14,
"inboxID": 3,
"server": "online",
"online_reference": "5234-my-code",
"online_extra_info": 7
}


Response-Explain:

Parameter

Description / Example

status

"OK" always

event

online

accountID

The account ID

agentID

The agent ID

inboxID

The inbox ID

server

The server subdomain

online_reference

The reference value that was provided by you when creating the online

online_extra_info

Here you will see a number related to the online update event

number

When will you get this webhook?

1

New account was created

2

account status changed to "active"

3

account status changed to "suspended"

4

account was deleted

5

new WhatsApp inbox was created

6

WhatsApp inbox was deleted

7

new agent login link was created

Event: partners/package - yet to be determined