Skip to main content

Send SMS log details

Please make sure you have an API up and running, similar to the endpoint shown below where 'your-custom-url' is your company domain. Onoff suggest to add an api-key as described in Authorization.

 POST https://<your-custom-url>/v1/onoff/sms 

Request

Body example

{
"id": "12345",
"eventName": "SMS",
"onoffUserName": "John Doe",
"onoffUserEmail": "john.doe@example.com",
"onoffUserNumber": "1234567890",
"externalNumber": "0987654321",
"externalName": "John Smith",
"externalEmail": "smith@example.com",
"date": "2023-05-20T14:30:00Z",
"smsDirection": "SENT",
"body": "This is the body of the SMS"
}

Field explanation

  • id String Unique id of the SMS log details
  • eventName String This is the type of the event sent. Currently, the only value is SMS for SMS detail log
  • onoffUserName String Username of the onoff user who is involved in the call
  • onoffUserEmail String Email of the onoff user who is involved in the call
  • onoffUserNumber String Phone number of the person who has Onoff account
  • externalNumber String Phone number of the second party
  • externalName String If the second party is in the contacts of the onoff user, then the first and last name will be sent. Otherwise, will not be sent
  • externalEmail String If the second party is in the contacts of the onoff user, then the contact email will be sent. Otherwise, will not be sent
  • date Date Date when the SMS was sent or received
  • smsDirection String Direction of the SMS. Only two possible values, SENT or RECEIVED
  • body String Content of the message

Response

An empty Json or String is fine for us. What is important is that the HTTP Status in the response is 200 OK.

Body example

{
}

Errors

If after onoff makes the request to your specific domain, we receive 4xx or 5xx HTTP Status in the response, we will retry 4 times more to deliver the event info. After the last attempt, we do not succeed in the delivery, onoff will discard the log meaning it will be lost.

Recommendations

  • Idempotency: We look forward for you to implement a webhook in idempotent manner to avoid duplications in your side. A better explanation about the concept of idempotency here. Just note that each event that we send you has an unique UUID so that you can verify if it was processed before or not.

  • Timeouts: We expect your service to handle requests properly. Our service make request with the following timeouts

    • Connect timeout: 1000 ms
    • Read timeout: 10000 ms