General
This type of subscription will create a subscription which listens to any outlets which are already authorized by partner.
The methods available in Notification Subscriptions are listed in the table given below.
HTTP Method | Endpoint | Description | |
---|---|---|---|
POST | /integrations/partner/v1/notification-subscriptions | It is used to subscribe to a specific event notification. | |
GET | /integrations/partner/v1/notification-subscriptions | It is used to get the list of subscriptions. | |
GET | /integrations/partner/v1/notification-subscriptions/{notification_id} | It is used to get details of a subscription. | |
PUT | /integrations/partner/v1/notification-subscriptions/{notification_id} | It is used to edit the notification subscription. | |
DELETE | /integrations/partner/v1/notification-subscriptions/{notification_id} | It is used to delete a subscription. |
Create Notification Subscription
You can subscribe to specific events you are interested in.
After the subscription is created, when a specific event occurs, HTTP request is made to the URL specified in the notification.
POST /integrations/partner/v1/notification-subscriptions
Sample Request
curl -X POST https://api.partner-sandbox.gobiz.co.id/integrations/partner/v1/notification-subscriptions \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d $'
{
"event": "gofood.order.driver_arrived",
"url": "https://sample-endpoint.com/notifications",
"active": true
}
'
Request Parameters
JSON Attribute | Description | Type | Required |
---|---|---|---|
event | Type of event notification to subscribe. | String | Required |
url | URL at which notification is to be received. | String(URI) | Required |
active | Status of the subscription. The default value is true . Note: If false , notification is not sent. | Boolean | Optional |
Sample Response - 201 Success
{
"success": true,
"data": {
"subscription": {
"id": "96f614f6-745e-47f5-ad68-c0c8e9ba8dc8",
"event": "gofood.order.driver_arrived",
"url": "https://sample-endpoint.com/notifications",
"active": true,
"created_at": "2019-08-24T14:15:22Z"
}
}
}
Response Parameters - 201 Success
JSON Attribute | Description | Type |
---|---|---|
success | Status of the request. Value true indicates successful submission of the request. | Boolean |
data | Details of the subscription. | Object |
» subscription | Subscription object. | Object |
- To perform this operation, you must be authenticated using
go_auth_client_credentials(partner:outlet:read)
orgo_auth_client_credentials(payment:transaction:read)
. - For list of available events, refer Events List.
- For handling the notifications, refer Receiving Notifications.
- Possible error responses are
401
,404
,406
, and415
. Please refer Error Glossary.
Get Notification Subscriptions
By using this method, you can view the list of subscriptions.
GET /integrations/partner/v1/notification-subscriptions
Sample Request
curl -X GET https://api.partner-sandbox.gobiz.co.id/integrations/partner/v1/notification-subscriptions \
-H 'Authorization: Bearer {access-token}'
Sample Response - 200 Success
{
"success": true,
"data": {
"subscriptions": [
{
"id": "96f614f6-745e-47f5-ad68-c0c8e9ba8dc8",
"event": "gofood.order.driver_arrived",
"url": "https://sample-endpoint.com/notifications",
"active": true,
"created_at": "2019-08-24T14:15:22Z"
}
]
}
}
Response Parameters - 200 Success
JSON Attribute | Description | Type |
---|---|---|
success | Status of the request. Value true indicates successful submission of the request. | Boolean |
data | Details of the subscription. | Object |
» subscriptions | Array of Subscription object. | Array(Object) |
- To perform this operation, you must be authenticated using
go_auth_client_credentials(partner:outlet:read)
orgo_auth_client_credentials(payment:transaction:read)
. - For list of available events, refer Events List.
- For handling the notifications, refer Receiving Notifications.
- Possible error responses are
401
,404
,406
, and415
. Please refer Error Glossary.
Get Notification Subscription Detail
By using this method, you can get the detailed information about a subscription.
GET /integrations/partner/v1/notification-subscriptions/{notification_id}
Sample Request
curl -X GET https://api.partner-sandbox.gobiz.co.id/integrations/partner/v1/notification-subscriptions/{notification_id} \
-H 'Authorization: Bearer {access-token}'
Path Parameters
Name | Description | Type | Required |
---|---|---|---|
notification_id | ID of the notification. | String | Required |
Sample Response - 200 Success
{
"success": true,
"data": {
"subscription": {
"id": "96f614f6-745e-47f5-ad68-c0c8e9ba8dc8",
"event": "gofood.order.driver_arrived",
"url": "https://sample-endpoint.com/notifications",
"active": true,
"created_at": "2019-08-24T14:15:22Z"
}
}
}
Response Parameters - 200 Success
JSON Attribute | Description | Type |
---|---|---|
success | Status of the request. Value true indicates successful submission of the request. | Boolean |
data | Details of the subscription. | Object |
» subscription | Subscription object. | Object |
- To perform this operation, you must be authenticated using
go_auth_client_credentials(partner:outlet:read)
orgo_auth_client_credentials(payment:transaction:read)
. - For list of available events, refer Events List.
- For handling the notifications, refer Receiving Notifications.
- Possible error responses are
401
,404
,406
, and415
. Please refer Error Glossary.
Update Notification Subscription
By using this method, you can edit the existing notification subscription. You can change the status of subscription and URL using this method.
PUT /integrations/partner/v1/notification-subscriptions/{notification_id}
Sample Request
curl -X PUT https://api.partner-sandbox.gobiz.co.id/integrations/partner/v1/notification-subscriptions/{notification_id} \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d $'
{
"event": "gofood.order.driver_arrived",
"url": "https://sample-endpoint.com/notifications",
"active": true
}
'
Path Parameters
Name | Description | Type | Required |
---|---|---|---|
notification_id | ID of the notification. | String | Required |
Request Parameters
JSON Attribute | Description | Type | Required |
---|---|---|---|
event | Type of event notification to subscribe. | String | Optional |
url | URL at which notification is to be received. | String(URI) | Optional |
active | Status of the subscription. The default value is true . Note: If false , the subscription is deactivated. | Boolean | Optional |
Sample Response - 200 Success
{
"success": true,
"data": {
"subscription": {
"id": "96f614f6-745e-47f5-ad68-c0c8e9ba8dc8",
"event": "gofood.order.driver_arrived",
"url": "https://sample-endpoint.com/notifications",
"active": true,
"created_at": "2019-08-24T14:15:22Z"
}
}
}
Response Parameters - 200 Success
JSON Attribute | Description | Type |
---|---|---|
success | Status of the request. Value true indicates successful submission of the request. | Boolean |
data | Details of the subscription. | Object |
» subscription | Subscription object. | Object |
- To perform this operation, you must be authenticated using
go_auth_client_credentials(partner:outlet:read)
orgo_auth_client_credentials(payment:transaction:read)
. - For list of available events, refer Events List.
- For handling the notifications, refer Receiving Notifications.
- Possible error responses are
401
,404
,406
, and415
. Please refer Error Glossary.
Delete Notification Subscription
By using this method, you can delete a subscription.
DELETE /integrations/partner/v1/notification-subscriptions/{notification_id}
Sample Request
curl -X DELETE https://api.partner-sandbox.gobiz.co.id/integrations/partner/v1/notification-subscriptions/{notification_id} \
-H 'Authorization: Bearer {access-token}'
Path Parameters
Name | Description | Type | Required |
---|---|---|---|
notification_id | ID of the notification. | String | Required |
Sample Response - 200 Success
{
"success": true,
"data": {}
}
Response Parameters - 200 Success
JSON Attribute | Description | Type |
---|---|---|
success | Status of the request. Value true indicates successful submission of the request. | Boolean |
data | - | Object |
To perform this operation, you must be authenticated using go_auth_client_credentials(partner:outlet:read)
or go_auth_client_credentials(payment:transaction:read)
.