Format a webhook event
const url = 'https://client-api.abi.ai/webhook/format-event';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"questionResolved","userId":"abi12345","caseId":"8910zyx321cba"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://client-api.abi.ai/webhook/format-event \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "questionResolved", "userId": "abi12345", "caseId": "8910zyx321cba" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Format a registered standard event locally. Include userId and/or caseId only when the formatted payload needs that resource.
object
Registered event name to format.
Example
questionResolvedConsultation identifier to include as the case payload
Example
8910zyx321cbaAbi user identifier to include as the user payload
Example
abi12345Example
{ "type": "questionResolved", "userId": "abi12345", "caseId": "8910zyx321cba"}Responses
Section titled “Responses”Webhook event formatted.
Standard event payload constructed from the registered event and any supplied resource identifiers. Health Navigator deliveries use their own v2 payloads.
object
Registered event name that will be delivered.
The Abi record representing a person who can use a configured service.
object
The unique identifier Abi assigns to the user account.
An optional identifier from the partner system.
The user’s first name.
The user’s surname.
The user’s email address.
The user’s mobile number including international dialing code (E.164).
The user’s address.
The user’s configured role.
The user’s weight
The unit used for weight.
The user’s national identifier
The user’s date of birth.
The user’s gender where supplied.
The language used to communicate with Abi.
The user’s nationality or country code.
The country where the user lives or is currently located.
The country in which the user was born.
The country in which responding healthcare professionals are licensed.
The partner company recorded in Abi.
The permitted number of associated accounts for an enabled group-account policy.
The date and time at which the user’s subscription starts.
The date and time at which the user’s subscription ends
The recorded Terms and Conditions acceptance value
The recorded Privacy Notice acceptance value
Additional agreed partner metadata for the user.
object
The parent account identifier for a group-account user
The user’s current access status.
The durable record returned by the consultation endpoints. Fields such as answers, professional information, files, and ratings appear as the consultation progresses.
object
The Abi identifier for the consultation.
The Abi identifier of the user who submitted the consultation.
The current consultation workflow status.
The date and time the consultation was created in Abi.
The medical questions and, when available, their answers and professional information.
object
The question submitted by the user.
The response provided by the healthcare professional
Images or documents provided through the approved journey.
Information about the professional who resolved a consultation, when available.
object
object
Time this question was recorded.
User rating recorded when the consultation was closed.
The healthcare professional associated with the latest claim
object
Information about the professional who resolved a consultation, when available.
object
object
Short-lived URL for the completed indication survey
A consultation document that is available to retrieve.
object
Short-lived download URL when the file is ready.
Payment information returned for consultations that require a user payment.
object
Whether payment is required before the consultation can proceed.
Payment URL when payment is required.
Price of the consultation
ISO 4217 currency code
Structured medical-advice classification when it is available for the consultation.
object
Sick notes issued for this consultation when available.
object
Referrals issued for this consultation when available.
object
Example
{ "eventName": "questionResolved", "user": { "id": "abi12345", "firstName": "Jane", "lastName": "Doe", "email": "janedoe@example.com", "gender": "female", "phone": "+441234567890", "origin": "gb", "location": "es", "country": "it", "physicianCountry": "es", "language": "en", "dateOfBirth": "1994-10-07", "partnerName": "Abi", "uniqueId": "123abc789xyz", "userStatus": "activeUser", "associatedAccounts": 5 }, "case": { "consultationId": "8910zyx321cba", "status": "open", "userId": "abi12345", "questions": [ { "question": "I have a burning sensation in my gut after dinner. Could this be acid reflux?", "attachments": [ "https://clientdomain.example/image-provided-by-user/1.jpg", "https://clientdomain.example/document-provided-by-user/2.pdf" ] } ], "createdAt": "2020-11-27" }}Request could not be completed.
object
Short machine-readable error code.
Human-readable explanation of the error.
Examplegenerated
{ "code": "example", "message": "example"}Request could not be completed.
object
Short machine-readable error code.
Human-readable explanation of the error.
Examplegenerated
{ "code": "example", "message": "example"}