Skip to main content

Create Consultation Push Notification

Notify users for certain epharmacy usecases. e.g. Doctor is available for mini consultation chat , incoming connsultation chat message etc.

Pathโ€‹

post

{host}/v1/epharmacy/partner/consultation/push-notification

Request Headerโ€‹

ParameterTypeDescriptionExampleRequired
X-Consultation-Partner
string
Partner identifier (case-sensitive)
halodoc
true
Authorization
string
Access Token with Bearer. Refers to Authentication Guide
Bearer LSPr7x7sRGaewzwZE6IcuA
true

Request Parametersโ€‹

NameTypeRequiredExampleDescription
notifier_key
Integer
Required
1
Nofier identify
tokopedia_consultation_id
Integer
Required
123
Tokopedia consultation identifier
message_details
Object
Required

Notifier Keyโ€‹

KeyDescription
1
Chat doctor started
2
Incoming chat message

Example Requestโ€‹

when chat doctor startedโ€‹

curl --location --request POST 'https://fs.tokopedia.net/v1/epharmacy/partner/consultation/push-notification' \
--header 'X-Consultation-Partner: halodoc' \
--header 'Authorization: Bearer token' \
--data-raw '{
"notifier_key": 1,
"tokopedia_consultation_id": 45353,
"message_details": {
"partner_consultation_id": "consultation-id",
"doctor_name": "L. Suarez",
"timestamp": "2006-01-02T15:04:05Z07:00"
}
}'

when incoming chat messageโ€‹

curl --location --request POST 'https://fs.tokopedia.net/v1/epharmacy/partner/consultation/push-notification' \
--header 'X-Consultation-Partner: halodoc' \
--header 'Authorization: Bearer token' \
--data-raw '{
"notifier_key": 2,
"tokopedia_consultation_id": 45353,
"message_details": {
"partner_consultation_id": "consultation-id",
"doctor_name": "L. Suarez",
"doctor_message": "this is a message from the doctor",
"timestamp": "2006-01-02T15:04:05Z07:00"
}
}'

Success Response Exampleโ€‹

{
"header": {
"server_process_time": "399.238721ms",
"code": 200
},
"status": "ok",
"error" : ""
}

Error Response Exampleโ€‹

{
"header": {
"server_process_time": "718.792ยตs",
"code": 400
},
"status": null,
"error": "error message"
}

Have a feedback?