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: Facebook

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


{
"status": "OK",
"event": "facebook",
"apiKey": "your-api-key-for-the-service",
"from" "your-from-id-for-the-service",
"facebook_type": 2,
"facebook_type_name": "Instagram Messenger",
"facebook_reference": "my-reference",
"server": "online",
"account_id": 1,
"inbox_id": 2,
"page_id": "621346235235462936",
"page_name": "My Business",
"page_category": "Retail Company",
"page_link": "https://facebook.com/621346235235462936",
"page_about": "Page description",
"page_fan_count": 100,
"page_picture": "https://...../picture.jpg",
"admin_name": "John",
"admin_email": "owner@business.com",
"instagram_id": "52351253445",
"instagram_username": "@username",
"instagram_name": "John",
"instagram_profile_picture": "https://...../picture.jpg",
"instagram_followers_count": 500,
"instgram_media_count": 51,
"instagram_biography": "This is the instagram profile about",
"instagram_website": "URL in the bio"
}



Response-Explain:

Parameter

Description

Example

status

"OK" always

OK

event

"facebook" always

facebook

apiKey

The apiKey for the service, this is how you initiate messages in the facebook outgoing messages

52353-grtwer6-5gew6ye-5f4gs4

from

The ID we generate for you, that comes together with the apiKey in order to send outgoing messages.

this contains 15 digits.

623748845667358

facebook_type

The type that was onboarder.

1 - facebook messenger

2 - instagram messenger

3 - facebook page (posts and comments)

4 - instagram page (posts and comments)

1

facebook_type_name

same as the "facebook_type" just in text:

"Facebook Messenger"

"Instagram Messenger"

"Facebook Page (posts & comments)"

"Instagram Page (posts & comments)"

Facebook Messenger

facebook_reference

The reference value that was provided by you when creating the onboarding link

my-reference

server

online server, if provided during onboarding

server

account_id

account id if provider during onboarding

1

inbox_id

inbox id if provided during onboarding

2

page_id

The page id of the facebook account (relevant for all 4 types of onboarding).

Even when you connect an instagram account only, there is still a facebook page id since instagram account is always connected to a facebook page.

123637468573457

page_name

The facebook page name (of that page_id)

My Business

page_category

The category of the page

Retail Company

page_link

The facebook page link URL

https://facebook.com/5235234132

page_about

The Facebook page about information

About my business

page_fan_acount

The facebook page amount of fans (followers) on the onboarding time

400

page_picture

The profile picture of the facebook page

https://..../picture.jpg

admin_name

The facebook page admin name

Goerge Levi

admin_email

The facebook page admin email address

george@business.com

instagram_id

The instagram page id

Relevant only for facebook_type 2 or 4

6346457468

instagram_username

The instagram username

Relevant only for facebook_type 2 or 4

@george_flowers

instagram_name

The instagram page name

Relevant only for facebook_type 2 or 4

My Flowers Business

instagram_profile_picture

The instagram page profile picture

Relevant only for facebook_type 2 or 4

https://..../profile.jpg

instagram_followers_count

The instagram page total followers account on the onboarding time

Relevant only for facebook_type 2 or 4

530

instagram_media_count

Total media uploaded to instagram page (total posts)

Relevant only for facebook_type 2 or 4

54

instagram_biography

The biography you wrote on your instagram page

Relevant only for facebook_type 2 or 4

This is my flowers shop

instagram_website

The website you provided on the instagram page

Relevant only for facebook_type 2 or 4

http://flowersshop.com