NAV
cURL

Introduction

Dive into our full API Reference Documentation and seamlessly integrate Voice and SMS functionalities into your website or application. This API uses HTTP verbs and a RESTful endpoint structure. Your Account SID and Auth Token is used as the API Authorization framework. Request and response payloads are formatted as JSON using UTF-8 encoding and URL encoded values.

Make an HTTP Request

There are a lot of ways you can make an HTTP request to Somleng. You can use a Helper Library or SDK for your preferred programming language or you can make a raw HTTP request in your code by using a tool like Postman.

Credentials

All requests to Somleng need to be authenticated. Somleng using HTTP basic auth, which use the following username/password schemes:

Account SID and Auth Token

The account SID and auth token are the master keys to your account.

Username Password
AccountSid AuthToken

Store Your Somleng Credentials Securely

It's important to keep credentials such as your Somleng Account SID and Auth token secure by storing them in a way that prevents unauthorized access. One common method is to store them in environment variables which are then accessed from your app. This keeps them out of code and other places where credentials don't belong.

On the right is an example in Node.js ---->

const accountSid = process.env.SOMLENG_ACCOUNT_SID;
const authToken = process.env.SOMLENG_AUTH_TOKEN;
const client = require('somleng')(accountSid, authToken);

// Make API calls here...

Helper Libraries

The following is a list of officially supported helper libraries for Somleng. Please refer to the documentation in each library for more details.

Demo Applications

The following is a list of demo applications which you can use to get started with Somleng.

Recordings

Fetch a recording resource

Request

curl -g "https://api.somleng.org/2010-04-01/Accounts/eb31f0e0-a9e4-45b6-b024-343b2998d8dc/Recordings/39544c14-80fa-4694-9717-6f77ca79e6ec.json" -X GET 

Endpoint

GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Recordings/:sid.json

GET https://api.somleng.org/2010-04-01/Accounts/eb31f0e0-a9e4-45b6-b024-343b2998d8dc/Recordings/39544c14-80fa-4694-9717-6f77ca79e6ec.json

Parameters

None known.

Response


200 OK
{
  "api_version": "2010-04-01",
  "sid": "39544c14-80fa-4694-9717-6f77ca79e6ec",
  "account_sid": "eb31f0e0-a9e4-45b6-b024-343b2998d8dc",
  "date_created": "Fri, 23 Feb 2024 10:04:10 -0000",
  "date_updated": "Fri, 23 Feb 2024 10:04:10 -0000",
  "call_sid": "d3ed1ae6-496b-4b88-8f4f-10960313e83c",
  "conference_sid": null,
  "channels": 1,
  "start_time": "2024-02-23T10:04:10.899Z",
  "duration": null,
  "price": null,
  "price_unit": null,
  "source": "RecordVerb",
  "status": "processing",
  "error_code": null,
  "encryption_details": null,
  "track": "both",
  "uri": "/2010-04-01/Accounts/eb31f0e0-a9e4-45b6-b024-343b2998d8dc/Calls/d3ed1ae6-496b-4b88-8f4f-10960313e83c/Recordings/39544c14-80fa-4694-9717-6f77ca79e6ec.json"
}

Fetch a recording as mp3

Request

curl -g "https://api.somleng.org/2010-04-01/Accounts/1e2e5e3d-9e53-4022-aba7-ac9bc4c36745/Recordings/b92c6d67-3849-4f54-aca7-d56d6d967657.mp3" -X GET 

Endpoint

GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Recordings/:sid.mp3

GET https://api.somleng.org/2010-04-01/Accounts/1e2e5e3d-9e53-4022-aba7-ac9bc4c36745/Recordings/b92c6d67-3849-4f54-aca7-d56d6d967657.mp3

Parameters

None known.

Response


302 Found

Fetch a recording

Request

curl -g "https://api.somleng.org/2010-04-01/Accounts/14f609c7-039a-4cea-82bb-c9b73bb0146e/Recordings/fb35696c-41af-4706-972d-c561e43172b4" -X GET 

Endpoint

GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Recordings/:sid

GET https://api.somleng.org/2010-04-01/Accounts/14f609c7-039a-4cea-82bb-c9b73bb0146e/Recordings/fb35696c-41af-4706-972d-c561e43172b4

Parameters

None known.

Response


302 Found

List recordings by call

Request

curl -g "https://api.somleng.org/2010-04-01/Accounts/76d302b3-cb4e-45da-bae8-59fde7f2bb23/Calls/ef20b162-6a28-428f-a568-d08c68faec14/Recordings" -X GET \
    -u 76d302b3-cb4e-45da-bae8-59fde7f2bb23:mnUKgE7vYVBvarNzozBRY8IVgiQvrET_0bDIfKdJg5A

Endpoint

GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Calls/:call_sid/Recordings

GET https://api.somleng.org/2010-04-01/Accounts/76d302b3-cb4e-45da-bae8-59fde7f2bb23/Calls/ef20b162-6a28-428f-a568-d08c68faec14/Recordings

Parameters

None known.

Response


200 OK
{
  "recordings": [
    {
      "api_version": "2010-04-01",
      "sid": "375d0a66-7d3c-4f72-99d0-c252b6f37538",
      "account_sid": "76d302b3-cb4e-45da-bae8-59fde7f2bb23",
      "date_created": "Fri, 23 Feb 2024 10:04:11 -0000",
      "date_updated": "Fri, 23 Feb 2024 10:04:11 -0000",
      "call_sid": "ef20b162-6a28-428f-a568-d08c68faec14",
      "conference_sid": null,
      "channels": 1,
      "start_time": "2024-02-23T10:04:11.119Z",
      "duration": "0",
      "price": null,
      "price_unit": null,
      "source": "RecordVerb",
      "status": "completed",
      "error_code": null,
      "encryption_details": null,
      "track": "both",
      "uri": "/2010-04-01/Accounts/76d302b3-cb4e-45da-bae8-59fde7f2bb23/Calls/ef20b162-6a28-428f-a568-d08c68faec14/Recordings/375d0a66-7d3c-4f72-99d0-c252b6f37538.json"
    }
  ],
  "uri": "/2010-04-01/Accounts/76d302b3-cb4e-45da-bae8-59fde7f2bb23/Calls/ef20b162-6a28-428f-a568-d08c68faec14/Recordings",
  "page": 0,
  "page_size": 50,
  "first_page_uri": "/2010-04-01/Accounts/76d302b3-cb4e-45da-bae8-59fde7f2bb23/Calls/ef20b162-6a28-428f-a568-d08c68faec14/Recordings?Page=0",
  "previous_page_uri": "/2010-04-01/Accounts/76d302b3-cb4e-45da-bae8-59fde7f2bb23/Calls/ef20b162-6a28-428f-a568-d08c68faec14/Recordings?Page=0&PageToken=PB375d0a66-7d3c-4f72-99d0-c252b6f37538",
  "next_page_uri": null
}

List recordings by account

Request

curl -g "https://api.somleng.org/2010-04-01/Accounts/d7114599-605b-4275-ba5b-def9ec60784f/Recordings" -X GET \
    -u d7114599-605b-4275-ba5b-def9ec60784f:wB9tw48OsUqbwpYJdGPArHKEa_doR2I6F7XDA-6qVEk

Endpoint

GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Recordings

GET https://api.somleng.org/2010-04-01/Accounts/d7114599-605b-4275-ba5b-def9ec60784f/Recordings

Parameters

None known.

Response


200 OK
{
  "recordings": [
    {
      "api_version": "2010-04-01",
      "sid": "145c4cb5-5972-4b0b-954f-0bcb88b44413",
      "account_sid": "d7114599-605b-4275-ba5b-def9ec60784f",
      "date_created": "Fri, 23 Feb 2024 10:04:11 -0000",
      "date_updated": "Fri, 23 Feb 2024 10:04:11 -0000",
      "call_sid": "749af25d-406e-4319-97f1-34e37dbe0256",
      "conference_sid": null,
      "channels": 1,
      "start_time": "2024-02-23T10:04:11.220Z",
      "duration": null,
      "price": null,
      "price_unit": null,
      "source": "RecordVerb",
      "status": "processing",
      "error_code": null,
      "encryption_details": null,
      "track": "both",
      "uri": "/2010-04-01/Accounts/d7114599-605b-4275-ba5b-def9ec60784f/Calls/749af25d-406e-4319-97f1-34e37dbe0256/Recordings/145c4cb5-5972-4b0b-954f-0bcb88b44413.json"
    },
    {
      "api_version": "2010-04-01",
      "sid": "5a853b30-e79b-4027-89c3-080787b15d2f",
      "account_sid": "d7114599-605b-4275-ba5b-def9ec60784f",
      "date_created": "Fri, 23 Feb 2024 10:04:11 -0000",
      "date_updated": "Fri, 23 Feb 2024 10:04:11 -0000",
      "call_sid": "2b13055f-96bb-46ec-97ca-b151441e2178",
      "conference_sid": null,
      "channels": 1,
      "start_time": "2024-02-23T10:04:11.201Z",
      "duration": null,
      "price": null,
      "price_unit": null,
      "source": "RecordVerb",
      "status": "processing",
      "error_code": null,
      "encryption_details": null,
      "track": "both",
      "uri": "/2010-04-01/Accounts/d7114599-605b-4275-ba5b-def9ec60784f/Calls/2b13055f-96bb-46ec-97ca-b151441e2178/Recordings/5a853b30-e79b-4027-89c3-080787b15d2f.json"
    }
  ],
  "uri": "/2010-04-01/Accounts/d7114599-605b-4275-ba5b-def9ec60784f/Recordings",
  "page": 0,
  "page_size": 50,
  "first_page_uri": "/2010-04-01/Accounts/d7114599-605b-4275-ba5b-def9ec60784f/Recordings?Page=0",
  "previous_page_uri": "/2010-04-01/Accounts/d7114599-605b-4275-ba5b-def9ec60784f/Recordings?Page=0&PageToken=PB145c4cb5-5972-4b0b-954f-0bcb88b44413",
  "next_page_uri": null
}

Pagination

When fetching multiple pages of API results, use the provided next_page_uri parameter to retrieve the next page of results.

List resources with PageSize

Request

curl -g "https://api.somleng.org/2010-04-01/Accounts/386525fe-73df-45dd-8318-343a30cc9484/Calls?PageSize=2" -X GET \
    -u 386525fe-73df-45dd-8318-343a30cc9484:SWP0pUMVs4nxWNrNf2WB1Jc40JxugmDKmJnFu-h-NDw

Endpoint

GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Calls

GET https://api.somleng.org/2010-04-01/Accounts/386525fe-73df-45dd-8318-343a30cc9484/Calls?PageSize=2

Parameters

PageSize: 2
Name Description
PageSize How many resources to return in each list page. The default is 50, and the maximum is 100.

Response


200 OK
{
  "calls": [
    {
      "api_version": "2010-04-01",
      "sid": "bb8966a7-c8b2-4ef8-8470-c3237a0afd9e",
      "account_sid": "386525fe-73df-45dd-8318-343a30cc9484",
      "date_created": "Fri, 23 Feb 2024 10:04:12 -0000",
      "date_updated": "Fri, 23 Feb 2024 10:04:12 -0000",
      "annotation": null,
      "answered_by": null,
      "caller_name": null,
      "direction": "outbound-api",
      "duration": null,
      "end_time": null,
      "forwarded_from": null,
      "from": "2442",
      "from_formatted": "2442",
      "group_sid": null,
      "parent_call_sid": null,
      "phone_number_sid": null,
      "price": null,
      "price_unit": null,
      "start_time": null,
      "status": "queued",
      "subresource_uris": {
      },
      "to": "+85512334667",
      "to_formatted": "+855 12 334 667",
      "uri": "/2010-04-01/Accounts/386525fe-73df-45dd-8318-343a30cc9484/Calls/bb8966a7-c8b2-4ef8-8470-c3237a0afd9e"
    },
    {
      "api_version": "2010-04-01",
      "sid": "d8682ed3-b1d0-4110-b839-0cd1f9919de9",
      "account_sid": "386525fe-73df-45dd-8318-343a30cc9484",
      "date_created": "Fri, 23 Feb 2024 10:04:12 -0000",
      "date_updated": "Fri, 23 Feb 2024 10:04:12 -0000",
      "annotation": null,
      "answered_by": null,
      "caller_name": null,
      "direction": "outbound-api",
      "duration": null,
      "end_time": null,
      "forwarded_from": null,
      "from": "2442",
      "from_formatted": "2442",
      "group_sid": null,
      "parent_call_sid": null,
      "phone_number_sid": null,
      "price": null,
      "price_unit": null,
      "start_time": null,
      "status": "queued",
      "subresource_uris": {
      },
      "to": "+85512334667",
      "to_formatted": "+855 12 334 667",
      "uri": "/2010-04-01/Accounts/386525fe-73df-45dd-8318-343a30cc9484/Calls/d8682ed3-b1d0-4110-b839-0cd1f9919de9"
    }
  ],
  "uri": "/2010-04-01/Accounts/386525fe-73df-45dd-8318-343a30cc9484/Calls?PageSize=2",
  "page": 0,
  "page_size": 2,
  "first_page_uri": "/2010-04-01/Accounts/386525fe-73df-45dd-8318-343a30cc9484/Calls?Page=0&PageSize=2",
  "previous_page_uri": "/2010-04-01/Accounts/386525fe-73df-45dd-8318-343a30cc9484/Calls?Page=0&PageSize=2&PageToken=PBbb8966a7-c8b2-4ef8-8470-c3237a0afd9e",
  "next_page_uri": "/2010-04-01/Accounts/386525fe-73df-45dd-8318-343a30cc9484/Calls?Page=1&PageSize=2&PageToken=PAd8682ed3-b1d0-4110-b839-0cd1f9919de9"
}

Phone Calls

List phone calls

Request

curl -g "https://api.somleng.org/2010-04-01/Accounts/c797c16e-4bdd-49de-948a-b1fead2fd7ed/Calls" -X GET \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -u c797c16e-4bdd-49de-948a-b1fead2fd7ed:SPDuvG4qNU7lDjV5i4K4O1AFGtYdyD1mEyv7ZGCXTK8

Endpoint

GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Calls

GET https://api.somleng.org/2010-04-01/Accounts/c797c16e-4bdd-49de-948a-b1fead2fd7ed/Calls

Parameters

None known.

Response


200 OK
{
  "calls": [
    {
      "api_version": "2010-04-01",
      "sid": "79a705dd-3a50-42b5-bd6e-bc4e51936b0f",
      "account_sid": "c797c16e-4bdd-49de-948a-b1fead2fd7ed",
      "date_created": "Fri, 23 Feb 2024 10:04:18 -0000",
      "date_updated": "Fri, 23 Feb 2024 10:04:18 -0000",
      "annotation": null,
      "answered_by": null,
      "caller_name": null,
      "direction": "outbound-api",
      "duration": null,
      "end_time": null,
      "forwarded_from": null,
      "from": "2442",
      "from_formatted": "2442",
      "group_sid": null,
      "parent_call_sid": null,
      "phone_number_sid": null,
      "price": null,
      "price_unit": null,
      "start_time": null,
      "status": "queued",
      "subresource_uris": {
      },
      "to": "+85512334667",
      "to_formatted": "+855 12 334 667",
      "uri": "/2010-04-01/Accounts/c797c16e-4bdd-49de-948a-b1fead2fd7ed/Calls/79a705dd-3a50-42b5-bd6e-bc4e51936b0f"
    }
  ],
  "uri": "/2010-04-01/Accounts/c797c16e-4bdd-49de-948a-b1fead2fd7ed/Calls",
  "page": 0,
  "page_size": 50,
  "first_page_uri": "/2010-04-01/Accounts/c797c16e-4bdd-49de-948a-b1fead2fd7ed/Calls?Page=0",
  "previous_page_uri": "/2010-04-01/Accounts/c797c16e-4bdd-49de-948a-b1fead2fd7ed/Calls?Page=0&PageToken=PB79a705dd-3a50-42b5-bd6e-bc4e51936b0f",
  "next_page_uri": null
}

Fetch a call

Request

curl -g "https://api.somleng.org/2010-04-01/Accounts/ab6e0cff-d2ca-41f6-8424-9d138c22f498/Calls/5f80eb92-3e9a-4bad-8542-72ffc01041c9" -X GET \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -u ab6e0cff-d2ca-41f6-8424-9d138c22f498:ys9pMsz9svtoZ-db1zl2lAG7Uy30awvZjIDeidVF4gQ

Endpoint

GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Calls/:sid

GET https://api.somleng.org/2010-04-01/Accounts/ab6e0cff-d2ca-41f6-8424-9d138c22f498/Calls/5f80eb92-3e9a-4bad-8542-72ffc01041c9

Parameters

None known.

Response


200 OK
{
  "api_version": "2010-04-01",
  "sid": "5f80eb92-3e9a-4bad-8542-72ffc01041c9",
  "account_sid": "ab6e0cff-d2ca-41f6-8424-9d138c22f498",
  "date_created": "Fri, 23 Feb 2024 10:04:18 -0000",
  "date_updated": "Fri, 23 Feb 2024 10:04:18 -0000",
  "annotation": null,
  "answered_by": null,
  "caller_name": null,
  "direction": "outbound-api",
  "duration": null,
  "end_time": null,
  "forwarded_from": null,
  "from": "2442",
  "from_formatted": "2442",
  "group_sid": null,
  "parent_call_sid": null,
  "phone_number_sid": null,
  "price": null,
  "price_unit": null,
  "start_time": null,
  "status": "queued",
  "subresource_uris": {
  },
  "to": "+85512334667",
  "to_formatted": "+855 12 334 667",
  "uri": "/2010-04-01/Accounts/ab6e0cff-d2ca-41f6-8424-9d138c22f498/Calls/5f80eb92-3e9a-4bad-8542-72ffc01041c9"
}

Create a call

Request

curl "https://api.somleng.org/2010-04-01/Accounts/12b3e675-535b-41b6-899f-92e3d0c2232d/Calls" -d 'To=%2B299221234&From=1234&Url=https%3A%2F%2Fdemo.twilio.com%2Fdocs%2Fvoice.xml' -X POST \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -u 12b3e675-535b-41b6-899f-92e3d0c2232d:OntHBHv45BWrTMGwa99CiUA5Yyr2q8ZMn5daLzbW2zw

Endpoint

POST https://api.somleng.org/2010-04-01/Accounts/:account_sid/Calls

POST https://api.somleng.org/2010-04-01/Accounts/12b3e675-535b-41b6-899f-92e3d0c2232d/Calls

Parameters

To=%2B299221234&From=1234&Url=https%3A%2F%2Fdemo.twilio.com%2Fdocs%2Fvoice.xml
Name Description
To required The phone number to call.
From required The phone number to use as the caller id
Url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the method when the call connects.
Method The HTTP method we should use when calling the url parameter's value. Can be: GET or POST and the default is POST.
Twiml TwiML instructions for the call Somleng will use without fetching Twiml from Url parameter. If both Twiml and Url are provided then Twiml parameter will be ignored.
StatusCallback The URL we should call using the status_callback_method to send status information to your application. URLs must contain a valid hostname (underscores are not permitted).
StatusCallbackMethod The HTTP method we should use when calling the status_callback URL. Can be: GET or POST and the default is POST.

Response


201 Created
{
  "api_version": "2010-04-01",
  "sid": "ed430b8b-142a-4b1b-b3aa-7d820c785555",
  "account_sid": "12b3e675-535b-41b6-899f-92e3d0c2232d",
  "date_created": "Fri, 23 Feb 2024 10:04:18 -0000",
  "date_updated": "Fri, 23 Feb 2024 10:04:18 -0000",
  "annotation": null,
  "answered_by": null,
  "caller_name": null,
  "direction": "outbound-api",
  "duration": null,
  "end_time": null,
  "forwarded_from": null,
  "from": "1234",
  "from_formatted": "1234",
  "group_sid": null,
  "parent_call_sid": null,
  "phone_number_sid": null,
  "price": null,
  "price_unit": null,
  "start_time": null,
  "status": "queued",
  "subresource_uris": {
  },
  "to": "+299221234",
  "to_formatted": "+299 22 1234",
  "uri": "/2010-04-01/Accounts/12b3e675-535b-41b6-899f-92e3d0c2232d/Calls/ed430b8b-142a-4b1b-b3aa-7d820c785555"
}

Update a call

Request

curl "https://api.somleng.org/2010-04-01/Accounts/bc286d0c-c1ab-447d-a8e8-5839eeb17322/Calls/cf571ea3-a77e-4a14-a810-558e3192b684" -d 'Status=completed' -X POST \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -u bc286d0c-c1ab-447d-a8e8-5839eeb17322:IrtudXtAkmK88RrZ8WYz_r1AxXQZBCPu-zOI--DyOyI

Endpoint

POST https://api.somleng.org/2010-04-01/Accounts/:account_sid/Calls/:sid

POST https://api.somleng.org/2010-04-01/Accounts/bc286d0c-c1ab-447d-a8e8-5839eeb17322/Calls/cf571ea3-a77e-4a14-a810-558e3192b684

Parameters

Status=completed
Name Description
Status The new status of the resource. Can be: canceled or completed. Specifying canceled will attempt to hang up calls that are queued or ringing; however, it will not affect calls already in progress. Specifying completed will attempt to hang up a call even if it's already in progress.

Response


200 OK
{
  "api_version": "2010-04-01",
  "sid": "cf571ea3-a77e-4a14-a810-558e3192b684",
  "account_sid": "bc286d0c-c1ab-447d-a8e8-5839eeb17322",
  "date_created": "Fri, 23 Feb 2024 10:04:18 -0000",
  "date_updated": "Fri, 23 Feb 2024 10:04:18 -0000",
  "annotation": null,
  "answered_by": null,
  "caller_name": null,
  "direction": "outbound-api",
  "duration": null,
  "end_time": null,
  "forwarded_from": null,
  "from": "2442",
  "from_formatted": "2442",
  "group_sid": null,
  "parent_call_sid": null,
  "phone_number_sid": null,
  "price": null,
  "price_unit": null,
  "start_time": null,
  "status": "in-progress",
  "subresource_uris": {
  },
  "to": "+85512334667",
  "to_formatted": "+855 12 334 667",
  "uri": "/2010-04-01/Accounts/bc286d0c-c1ab-447d-a8e8-5839eeb17322/Calls/cf571ea3-a77e-4a14-a810-558e3192b684"
}

Messages

List messages

Request

curl -g "https://api.somleng.org/2010-04-01/Accounts/b59860d7-3edd-4a6d-b846-251b5e9fb92a/Messages" -X GET \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -u b59860d7-3edd-4a6d-b846-251b5e9fb92a:NJtYvYAiPZ747v2CJPrtyOM8Nf1QIoRKH6bZj-H3Z6o

Endpoint

GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages

GET https://api.somleng.org/2010-04-01/Accounts/b59860d7-3edd-4a6d-b846-251b5e9fb92a/Messages

Parameters

None known.

Response


200 OK
{
  "messages": [
    {
      "api_version": "2010-04-01",
      "sid": "6aee1bea-c574-497e-9a6a-17f5c10e3ec0",
      "account_sid": "b59860d7-3edd-4a6d-b846-251b5e9fb92a",
      "date_created": "Fri, 23 Feb 2024 10:04:26 -0000",
      "date_updated": "Fri, 23 Feb 2024 10:04:26 -0000",
      "body": "Hello World",
      "date_sent": null,
      "direction": "outbound-api",
      "error_code": null,
      "error_message": null,
      "from": "2442",
      "messaging_service_sid": null,
      "num_media": "0",
      "num_segments": "1",
      "price": null,
      "price_unit": null,
      "status": "accepted",
      "subresource_uris": {
      },
      "tags": {
      },
      "to": "+85512334667",
      "uri": "/2010-04-01/Accounts/b59860d7-3edd-4a6d-b846-251b5e9fb92a/Messages/6aee1bea-c574-497e-9a6a-17f5c10e3ec0"
    }
  ],
  "uri": "/2010-04-01/Accounts/b59860d7-3edd-4a6d-b846-251b5e9fb92a/Messages",
  "page": 0,
  "page_size": 50,
  "first_page_uri": "/2010-04-01/Accounts/b59860d7-3edd-4a6d-b846-251b5e9fb92a/Messages?Page=0",
  "previous_page_uri": "/2010-04-01/Accounts/b59860d7-3edd-4a6d-b846-251b5e9fb92a/Messages?Page=0&PageToken=PB6aee1bea-c574-497e-9a6a-17f5c10e3ec0",
  "next_page_uri": null
}

Delete a message

Request

curl "https://api.somleng.org/2010-04-01/Accounts/0a041018-9b60-4889-a626-831f0489f5cb/Messages/f817c70f-bc19-471d-9922-c0a13add4bb6" -d '' -X DELETE \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -u 0a041018-9b60-4889-a626-831f0489f5cb:Bmam4N90Lp8L1Eq_6vtsHoKba2GisgB5674sXQOMYB4

Endpoint

DELETE https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages/:sid

DELETE https://api.somleng.org/2010-04-01/Accounts/0a041018-9b60-4889-a626-831f0489f5cb/Messages/f817c70f-bc19-471d-9922-c0a13add4bb6

Parameters

Name Description
AccountSid required The SID of the Account that created the Message resources to delete.
Sid required The ID that uniquely identifies the Message resource to delete.

Response


204 No Content

Fetch a message

Request

curl -g "https://api.somleng.org/2010-04-01/Accounts/d8c594c5-7de5-4e56-a7c1-e2c2c3404df3/Messages/a3ca0c04-2277-4eed-bad2-114a0ac16f07" -X GET \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -u d8c594c5-7de5-4e56-a7c1-e2c2c3404df3:CI2At_gJd17Bt8oSI7D_bWZTXbGzlVu68irCEiHda5s

Endpoint

GET https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages/:sid

GET https://api.somleng.org/2010-04-01/Accounts/d8c594c5-7de5-4e56-a7c1-e2c2c3404df3/Messages/a3ca0c04-2277-4eed-bad2-114a0ac16f07

Parameters

None known.

Response


200 OK
{
  "api_version": "2010-04-01",
  "sid": "a3ca0c04-2277-4eed-bad2-114a0ac16f07",
  "account_sid": "d8c594c5-7de5-4e56-a7c1-e2c2c3404df3",
  "date_created": "Fri, 23 Feb 2024 10:04:26 -0000",
  "date_updated": "Fri, 23 Feb 2024 10:04:26 -0000",
  "body": "Hello World",
  "date_sent": null,
  "direction": "outbound-api",
  "error_code": null,
  "error_message": null,
  "from": "2442",
  "messaging_service_sid": null,
  "num_media": "0",
  "num_segments": "1",
  "price": null,
  "price_unit": null,
  "status": "accepted",
  "subresource_uris": {
  },
  "tags": {
  },
  "to": "+85512334667",
  "uri": "/2010-04-01/Accounts/d8c594c5-7de5-4e56-a7c1-e2c2c3404df3/Messages/a3ca0c04-2277-4eed-bad2-114a0ac16f07"
}

Create a Message through a Messaging Service

Request

curl "https://api.somleng.org/2010-04-01/Accounts/c6608a24-b012-41b4-9861-a8a7438df9eb/Messages" -d 'To=%2B855716788123&MessagingServiceSid=d439bf06-d335-4996-ab62-fe3255d53e12&Body=Hello+World' -X POST \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -u c6608a24-b012-41b4-9861-a8a7438df9eb:tZKAB7qaCSRxh7i6XWtI3OfISyrWkOMqb9J5JkUePnw

Endpoint

POST https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages

POST https://api.somleng.org/2010-04-01/Accounts/c6608a24-b012-41b4-9861-a8a7438df9eb/Messages

Parameters

To=%2B855716788123&MessagingServiceSid=d439bf06-d335-4996-ab62-fe3255d53e12&Body=Hello+World
Name Description
From A phone number in E.164 format. Required if MessagingServiceSid is not passed
MessagingServiceSid The SID of the Messaging Service you want to associate with the Message. Set this parameter to use the Messaging Service Settings you have configured and leave the From parameter empty. When only this parameter is set, we will select the From phone number for delivery.
Body required The text of the message you want to send. Can be up to 1,600 characters in length.
To required The destination phone number in E.164 format
StatusCallback The URL we should call to send status information to your application. If specified, we POST these message status changes to the URL: queued, failed, sent, delivered, or undelivered. Somleng will POST its standard request parameters as well as some additional parameters including MessageSid, MessageStatus, and ErrorCode. URLs must contain a valid hostname (underscores are not permitted).
StatusCallbackMethod The HTTP method we should use when calling the status_callback URL. Can be: GET or POST and the default is POST.
ValidityPeriod How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.
SmartEncoded Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: true or false.
ScheduleType Indicates your intent to schedule a message. Pass the value fixed to schedule a message at a fixed time.
SendAt The time that we will send the message. Must be in ISO 8601 format.

Response


201 Created
{
  "api_version": "2010-04-01",
  "sid": "720403e2-41bf-4bdc-9f94-fdd1031c5f26",
  "account_sid": "c6608a24-b012-41b4-9861-a8a7438df9eb",
  "date_created": "Fri, 23 Feb 2024 10:04:26 -0000",
  "date_updated": "Fri, 23 Feb 2024 10:04:26 -0000",
  "body": "Hello World",
  "date_sent": null,
  "direction": "outbound-api",
  "error_code": null,
  "error_message": null,
  "from": null,
  "messaging_service_sid": "d439bf06-d335-4996-ab62-fe3255d53e12",
  "num_media": "0",
  "num_segments": "1",
  "price": null,
  "price_unit": null,
  "status": "accepted",
  "subresource_uris": {
  },
  "tags": {
  },
  "to": "+855716788123",
  "uri": "/2010-04-01/Accounts/c6608a24-b012-41b4-9861-a8a7438df9eb/Messages/720403e2-41bf-4bdc-9f94-fdd1031c5f26"
}

Create a Message

Request

curl "https://api.somleng.org/2010-04-01/Accounts/5c524edf-2eab-4113-aabd-1519f9b3e94b/Messages" -d 'To=%2B855+716+788+123&From=%2B855+716+788+999&Body=Hello+World' -X POST \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -u 5c524edf-2eab-4113-aabd-1519f9b3e94b:2K4BET9d7zOtbd1RoWnMKG458q8QyTHuSh6q5mPBdAU

Endpoint

POST https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages

POST https://api.somleng.org/2010-04-01/Accounts/5c524edf-2eab-4113-aabd-1519f9b3e94b/Messages

Parameters

To=%2B855+716+788+123&From=%2B855+716+788+999&Body=Hello+World
Name Description
From A phone number in E.164 format. Required if MessagingServiceSid is not passed
MessagingServiceSid The SID of the Messaging Service you want to associate with the Message. Set this parameter to use the Messaging Service Settings you have configured and leave the From parameter empty. When only this parameter is set, we will select the From phone number for delivery.
Body required The text of the message you want to send. Can be up to 1,600 characters in length.
To required The destination phone number in E.164 format
StatusCallback The URL we should call to send status information to your application. If specified, we POST these message status changes to the URL: queued, failed, sent, delivered, or undelivered. Somleng will POST its standard request parameters as well as some additional parameters including MessageSid, MessageStatus, and ErrorCode. URLs must contain a valid hostname (underscores are not permitted).
StatusCallbackMethod The HTTP method we should use when calling the status_callback URL. Can be: GET or POST and the default is POST.
ValidityPeriod How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.
SmartEncoded Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: true or false.
ScheduleType Indicates your intent to schedule a message. Pass the value fixed to schedule a message at a fixed time.
SendAt The time that we will send the message. Must be in ISO 8601 format.

Response


201 Created
{
  "api_version": "2010-04-01",
  "sid": "684a39a2-ddf6-48c5-b759-68dfa5e3c86c",
  "account_sid": "5c524edf-2eab-4113-aabd-1519f9b3e94b",
  "date_created": "Fri, 23 Feb 2024 10:04:26 -0000",
  "date_updated": "Fri, 23 Feb 2024 10:04:26 -0000",
  "body": "Hello World",
  "date_sent": null,
  "direction": "outbound-api",
  "error_code": null,
  "error_message": null,
  "from": "+855716788999",
  "messaging_service_sid": null,
  "num_media": "0",
  "num_segments": "1",
  "price": null,
  "price_unit": null,
  "status": "queued",
  "subresource_uris": {
  },
  "tags": {
  },
  "to": "+855716788123",
  "uri": "/2010-04-01/Accounts/5c524edf-2eab-4113-aabd-1519f9b3e94b/Messages/684a39a2-ddf6-48c5-b759-68dfa5e3c86c"
}

Schedule a Message

Request

curl "https://api.somleng.org/2010-04-01/Accounts/8e1d4d72-c6a4-45e8-9ad6-dd18b35670d7/Messages" -d 'To=%2B855716788123&Body=Hello+World&SendAt=2024-02-28T10%3A04%3A26Z&ScheduleType=fixed&MessagingServiceSid=54833598-3827-4fa7-a2a9-8c33748c5c74' -X POST \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -u 8e1d4d72-c6a4-45e8-9ad6-dd18b35670d7:iebAh2gdQoPVeD9sNTgTFn-ln6iduS10HxO_NZsu-Gk

Endpoint

POST https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages

POST https://api.somleng.org/2010-04-01/Accounts/8e1d4d72-c6a4-45e8-9ad6-dd18b35670d7/Messages

Parameters

To=%2B855716788123&Body=Hello+World&SendAt=2024-02-28T10%3A04%3A26Z&ScheduleType=fixed&MessagingServiceSid=54833598-3827-4fa7-a2a9-8c33748c5c74
Name Description
From A phone number in E.164 format. Required if MessagingServiceSid is not passed
MessagingServiceSid The SID of the Messaging Service you want to associate with the Message. Set this parameter to use the Messaging Service Settings you have configured and leave the From parameter empty. When only this parameter is set, we will select the From phone number for delivery.
Body required The text of the message you want to send. Can be up to 1,600 characters in length.
To required The destination phone number in E.164 format
StatusCallback The URL we should call to send status information to your application. If specified, we POST these message status changes to the URL: queued, failed, sent, delivered, or undelivered. Somleng will POST its standard request parameters as well as some additional parameters including MessageSid, MessageStatus, and ErrorCode. URLs must contain a valid hostname (underscores are not permitted).
StatusCallbackMethod The HTTP method we should use when calling the status_callback URL. Can be: GET or POST and the default is POST.
ValidityPeriod How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.
SmartEncoded Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: true or false.
ScheduleType Indicates your intent to schedule a message. Pass the value fixed to schedule a message at a fixed time.
SendAt The time that we will send the message. Must be in ISO 8601 format.

Response


201 Created
{
  "api_version": "2010-04-01",
  "sid": "183dedfa-81fa-4216-b2fb-08b3f1507299",
  "account_sid": "8e1d4d72-c6a4-45e8-9ad6-dd18b35670d7",
  "date_created": "Fri, 23 Feb 2024 10:04:26 -0000",
  "date_updated": "Fri, 23 Feb 2024 10:04:26 -0000",
  "body": "Hello World",
  "date_sent": null,
  "direction": "outbound-api",
  "error_code": null,
  "error_message": null,
  "from": null,
  "messaging_service_sid": "54833598-3827-4fa7-a2a9-8c33748c5c74",
  "num_media": "0",
  "num_segments": "1",
  "price": null,
  "price_unit": null,
  "status": "scheduled",
  "subresource_uris": {
  },
  "tags": {
  },
  "to": "+855716788123",
  "uri": "/2010-04-01/Accounts/8e1d4d72-c6a4-45e8-9ad6-dd18b35670d7/Messages/183dedfa-81fa-4216-b2fb-08b3f1507299"
}

Cancel a scheduled message

Request

curl "https://api.somleng.org/2010-04-01/Accounts/166f9dc7-1daf-4a97-927b-614457a8b88b/Messages/5ecd03a1-cd32-4fcd-b579-6531aa6adda2" -d 'Status=canceled' -X POST \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -u 166f9dc7-1daf-4a97-927b-614457a8b88b:OqygJUCO67iHbRKGsIGqozH94abtrvNfSkkqAB03jLg

Endpoint

POST https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages/:sid

POST https://api.somleng.org/2010-04-01/Accounts/166f9dc7-1daf-4a97-927b-614457a8b88b/Messages/5ecd03a1-cd32-4fcd-b579-6531aa6adda2

Parameters

Status=canceled
Name Description
AccountSid required The SID of the Account that created the Message resources to update.
Sid required The ID that uniquely identifies the Message resource to update.
Body Must be an empty string (""). Required for redacting a message
Status When set as canceled, allows a message cancelation request if a message has not yet been sent.

Response


200 OK
{
  "api_version": "2010-04-01",
  "sid": "5ecd03a1-cd32-4fcd-b579-6531aa6adda2",
  "account_sid": "166f9dc7-1daf-4a97-927b-614457a8b88b",
  "date_created": "Fri, 23 Feb 2024 10:04:26 -0000",
  "date_updated": "Fri, 23 Feb 2024 10:04:26 -0000",
  "body": "Hello World",
  "date_sent": null,
  "direction": "outbound-api",
  "error_code": null,
  "error_message": null,
  "from": null,
  "messaging_service_sid": "da331cbf-b68d-4393-9d47-52ae6960959b",
  "num_media": "0",
  "num_segments": "1",
  "price": null,
  "price_unit": null,
  "status": "canceled",
  "subresource_uris": {
  },
  "tags": {
  },
  "to": "+85512334667",
  "uri": "/2010-04-01/Accounts/166f9dc7-1daf-4a97-927b-614457a8b88b/Messages/5ecd03a1-cd32-4fcd-b579-6531aa6adda2"
}

Redact a message

Request

curl "https://api.somleng.org/2010-04-01/Accounts/a674f484-cbb0-4448-984f-edcba8886e32/Messages/fb3b18d3-dbdb-40ba-9e06-12f2e8173f8b" -d 'Body=' -X POST \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -u a674f484-cbb0-4448-984f-edcba8886e32:n4ZExM45tMN3Rj0Zyw0_Objfo6F-s5kWxwfSqR5oZGs

Endpoint

POST https://api.somleng.org/2010-04-01/Accounts/:account_sid/Messages/:sid

POST https://api.somleng.org/2010-04-01/Accounts/a674f484-cbb0-4448-984f-edcba8886e32/Messages/fb3b18d3-dbdb-40ba-9e06-12f2e8173f8b

Parameters

Body=
Name Description
AccountSid required The SID of the Account that created the Message resources to update.
Sid required The ID that uniquely identifies the Message resource to update.
Body Must be an empty string (""). Required for redacting a message
Status When set as canceled, allows a message cancelation request if a message has not yet been sent.

Response


200 OK
{
  "api_version": "2010-04-01",
  "sid": "fb3b18d3-dbdb-40ba-9e06-12f2e8173f8b",
  "account_sid": "a674f484-cbb0-4448-984f-edcba8886e32",
  "date_created": "Fri, 23 Feb 2024 10:04:26 -0000",
  "date_updated": "Fri, 23 Feb 2024 10:04:26 -0000",
  "body": "",
  "date_sent": "Fri, 23 Feb 2024 10:04:26 -0000",
  "direction": "outbound-api",
  "error_code": null,
  "error_message": null,
  "from": "2442",
  "messaging_service_sid": null,
  "num_media": "0",
  "num_segments": "1",
  "price": null,
  "price_unit": null,
  "status": "sent",
  "subresource_uris": {
  },
  "tags": {
  },
  "to": "+85512334667",
  "uri": "/2010-04-01/Accounts/a674f484-cbb0-4448-984f-edcba8886e32/Messages/fb3b18d3-dbdb-40ba-9e06-12f2e8173f8b"
}

Verification Services

Fetch a Service

Request

curl -g "https://verify.somleng.org/v2/Services/821118e8-6353-4bd6-ba3c-753490013c29" -X GET \
    -u 00975d5e-f2a2-469c-9abd-ab97f9e2fdc0:pZu-kY0fNWTo-S_dtrCAykovyHm9qj7NytwMTpySfNE

Endpoint

GET https://verify.somleng.org/v2/Services/:sid

GET https://verify.somleng.org/v2/Services/821118e8-6353-4bd6-ba3c-753490013c29

Parameters

None known.

Response


200 OK
{
  "sid": "821118e8-6353-4bd6-ba3c-753490013c29",
  "account_sid": "00975d5e-f2a2-469c-9abd-ab97f9e2fdc0",
  "date_created": "2024-02-23T10:04:33Z",
  "date_updated": "2024-02-23T10:04:33Z",
  "friendly_name": "My Verification Service",
  "url": "http://verify.lvh.me/v2/Services/821118e8-6353-4bd6-ba3c-753490013c29",
  "code_length": 4
}

List all Services

Request

curl -g "https://verify.somleng.org/v2/Services" -X GET \
    -u e5bdb81d-07d1-4df8-a581-9d8159dac65b:ZC9tyKyxG-WDKBrwDWmbgArX4-zIdzPWBL0Ya_HBg84

Endpoint

GET https://verify.somleng.org/v2/Services

GET https://verify.somleng.org/v2/Services

Parameters

None known.

Response


200 OK
{
  "services": [
    {
      "sid": "976c734a-10de-4ed5-aa9a-e042cfc707ef",
      "account_sid": "e5bdb81d-07d1-4df8-a581-9d8159dac65b",
      "date_created": "2024-02-23T10:04:33Z",
      "date_updated": "2024-02-23T10:04:33Z",
      "friendly_name": "My Verification Service",
      "url": "http://verify.lvh.me/v2/Services/976c734a-10de-4ed5-aa9a-e042cfc707ef",
      "code_length": 4
    }
  ],
  "meta": {
    "url": "https://verify.somleng.org/v2/Services",
    "page": 0,
    "page_size": 50,
    "first_page_url": "https://verify.somleng.org/v2/Services?Page=0",
    "previous_page_url": "https://verify.somleng.org/v2/Services?Page=0&PageToken=PB976c734a-10de-4ed5-aa9a-e042cfc707ef",
    "next_page_url": null,
    "key": "services"
  }
}

Delete a Service

Request

curl "https://verify.somleng.org/v2/Services/2a4def30-353a-4310-866f-54963d86a25d" -d '' -X DELETE \
    -u df051137-5cdd-4e3f-ad73-a321be137925:rsG3gLCJ2GZmM7pDHiP5MdqknG6m5pfjTHM6DNE4e88 \
    -H "Content-Type: application/x-www-form-urlencoded"

Endpoint

DELETE https://verify.somleng.org/v2/Services/:sid

DELETE https://verify.somleng.org/v2/Services/2a4def30-353a-4310-866f-54963d86a25d

Parameters

Name Description
Sid required The SID of the Service Resource to delete.

Response


204 No Content

Update a Service

Request

curl "https://verify.somleng.org/v2/Services/5fb3a0f1-63af-40f3-8976-88367816e414" -d 'FriendlyName=Rocket+Ride+Service&CodeLength=6' -X POST \
    -u b2b4547e-7c98-4e4e-8541-14446b448153:_rsOYkHGJWQH4LEY4-tI_mzjXc8RscMje5MgWzP8KFA \
    -H "Content-Type: application/x-www-form-urlencoded"

Endpoint

POST https://verify.somleng.org/v2/Services/:sid

POST https://verify.somleng.org/v2/Services/5fb3a0f1-63af-40f3-8976-88367816e414

Parameters

FriendlyName=Rocket+Ride+Service&CodeLength=6
Name Description
Sid required The SID of the Service Resource to update.
FriendlyName required A descriptive string that you create to describe the verification service. It can be up to 32 characters long.
CodeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive.

Response


200 OK
{
  "sid": "5fb3a0f1-63af-40f3-8976-88367816e414",
  "account_sid": "b2b4547e-7c98-4e4e-8541-14446b448153",
  "date_created": "2024-02-23T10:04:33Z",
  "date_updated": "2024-02-23T10:04:33Z",
  "friendly_name": "Rocket Ride Service",
  "url": "http://verify.lvh.me/v2/Services/5fb3a0f1-63af-40f3-8976-88367816e414",
  "code_length": 6
}

Create a Verification Service

Request

curl "https://verify.somleng.org/v2/Services" -d 'account_sid=e6f0dc2c-86f2-42e8-b3e7-706479639dae&FriendlyName=My+Verification+Service' -X POST \
    -u e6f0dc2c-86f2-42e8-b3e7-706479639dae:z4R2tZXoG1sI0BdOJ644I-InkoRoGSDjehhrDjGr2p4 \
    -H "Content-Type: application/x-www-form-urlencoded"

Endpoint

POST https://verify.somleng.org/v2/Services

POST https://verify.somleng.org/v2/Services

Parameters

account_sid=e6f0dc2c-86f2-42e8-b3e7-706479639dae&FriendlyName=My+Verification+Service
Name Description
FriendlyName required A descriptive string that you create to describe the verification service. It can be up to 32 characters long.
CodeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive.

Response


201 Created
{
  "sid": "7175a5d8-ba39-4640-bbd7-e5312ca3ea30",
  "account_sid": "e6f0dc2c-86f2-42e8-b3e7-706479639dae",
  "date_created": "2024-02-23T10:04:33Z",
  "date_updated": "2024-02-23T10:04:33Z",
  "friendly_name": "My Verification Service",
  "url": "http://verify.lvh.me/v2/Services/7175a5d8-ba39-4640-bbd7-e5312ca3ea30",
  "code_length": 6
}

Verifications

Start New SMS Verification

Request

curl "https://verify.somleng.org/v2/Services/490ade17-f393-464b-ba49-e8ff7b1f116d/Verifications" -d 'To=%2B85512334667&Channel=sms' -X POST \
    -u fa08094c-361a-4c6c-86da-c3cc766c5f96:7WaVm6jwZp78ofm_lyedMK9AGGpl5Tm1-mms6pZBKxY \
    -H "Content-Type: application/x-www-form-urlencoded"

Endpoint

POST https://verify.somleng.org/v2/Services/:service_sid/Verifications

POST https://verify.somleng.org/v2/Services/490ade17-f393-464b-ba49-e8ff7b1f116d/Verifications

Parameters

To=%2B85512334667&Channel=sms
Name Description
ServiceSid required The SID of the verification Service to create the resource under.
To required The phone number or email to verify. Phone numbers must be in E.164 format.
Channel required The verification method to use. One of: sms or call
Locale Locale will automatically resolve based on phone number country code of the recipient for SMS and call channel verifications. It will fallback to English if the selected translation is not available. This parameter will override the automatic locale resolution. The following locales are supported: en, fr, ja, nl, ar, ca, da, de, es, fi, id, it, ko, pl, pt, ru, sv, tr, uk, vi, af, cs, el, hi, hr, hu, kn, lt, mr, ms, nb, pt-br, ro, sk, te, th, tl, zh-cn, zh-hk, zh.

Response


200 OK
{
  "sid": "093ece41-fa3e-4f68-aa52-86eb0a301b3f",
  "account_sid": "fa08094c-361a-4c6c-86da-c3cc766c5f96",
  "date_created": "2024-02-23T10:04:35Z",
  "date_updated": "2024-02-23T10:04:35Z",
  "service_sid": "490ade17-f393-464b-ba49-e8ff7b1f116d",
  "to": "+85512334667",
  "channel": "sms",
  "status": "pending",
  "url": "http://verify.lvh.me/v2/Services/490ade17-f393-464b-ba49-e8ff7b1f116d/Verifications/093ece41-fa3e-4f68-aa52-86eb0a301b3f",
  "send_code_attempts": [
    {
      "attempt_sid": "58ee3cb8-eeed-46f1-977a-868ccf2a3372",
      "channel": "sms",
      "time": "2024-02-23T10:04:35Z"
    }
  ]
}

Start New Call Verification

Request

curl "https://verify.somleng.org/v2/Services/e201934b-31a8-4776-9622-aaafc57d87b9/Verifications" -d 'To=%2B85512334667&Channel=call' -X POST \
    -u f8b889fb-b48b-4aba-b48b-b98e14d48b7b:tFskZyjej7WwkGhgXub5Kz7INKHjt7cRFnOlzeh7b-g \
    -H "Content-Type: application/x-www-form-urlencoded"

Endpoint

POST https://verify.somleng.org/v2/Services/:service_sid/Verifications

POST https://verify.somleng.org/v2/Services/e201934b-31a8-4776-9622-aaafc57d87b9/Verifications

Parameters

To=%2B85512334667&Channel=call
Name Description
ServiceSid required The SID of the verification Service to create the resource under.
To required The phone number or email to verify. Phone numbers must be in E.164 format.
Channel required The verification method to use. One of: sms or call
Locale Locale will automatically resolve based on phone number country code of the recipient for SMS and call channel verifications. It will fallback to English if the selected translation is not available. This parameter will override the automatic locale resolution. The following locales are supported: en, fr, ja, nl, ar, ca, da, de, es, fi, id, it, ko, pl, pt, ru, sv, tr, uk, vi, af, cs, el, hi, hr, hu, kn, lt, mr, ms, nb, pt-br, ro, sk, te, th, tl, zh-cn, zh-hk, zh.

Response


200 OK
{
  "sid": "a438cd8b-f454-42ad-8676-a8d20019c5cf",
  "account_sid": "f8b889fb-b48b-4aba-b48b-b98e14d48b7b",
  "date_created": "2024-02-23T10:04:35Z",
  "date_updated": "2024-02-23T10:04:35Z",
  "service_sid": "e201934b-31a8-4776-9622-aaafc57d87b9",
  "to": "+85512334667",
  "channel": "call",
  "status": "pending",
  "url": "http://verify.lvh.me/v2/Services/e201934b-31a8-4776-9622-aaafc57d87b9/Verifications/a438cd8b-f454-42ad-8676-a8d20019c5cf",
  "send_code_attempts": [
    {
      "attempt_sid": "5bc13e8e-c469-4527-9500-d808e01938c6",
      "channel": "call",
      "time": "2024-02-23T10:04:35Z"
    }
  ]
}

Fetch a Verification

Request

curl -g "https://verify.somleng.org/v2/Services/be8f3acd-bb9a-46f5-a708-07528ba7e2e1/Verifications/5f3e16ce-682f-4e65-a61f-8b4ca2ead86e" -X GET \
    -u f600e3fb-0c82-495f-82bf-eee1d2b4731d:OolLfI2Lso-AmWVBkrBQflsaI1Fk-0uVRFtVoNzDwt8

Endpoint

GET https://verify.somleng.org/v2/Services/:service_sid/Verifications/:sid

GET https://verify.somleng.org/v2/Services/be8f3acd-bb9a-46f5-a708-07528ba7e2e1/Verifications/5f3e16ce-682f-4e65-a61f-8b4ca2ead86e

Parameters

None known.

Response


200 OK
{
  "sid": "5f3e16ce-682f-4e65-a61f-8b4ca2ead86e",
  "account_sid": "f600e3fb-0c82-495f-82bf-eee1d2b4731d",
  "date_created": "2024-02-23T10:04:35Z",
  "date_updated": "2024-02-23T10:04:35Z",
  "service_sid": "be8f3acd-bb9a-46f5-a708-07528ba7e2e1",
  "to": "+85512334667",
  "channel": "sms",
  "status": "pending",
  "url": "http://verify.lvh.me/v2/Services/be8f3acd-bb9a-46f5-a708-07528ba7e2e1/Verifications/5f3e16ce-682f-4e65-a61f-8b4ca2ead86e",
  "send_code_attempts": [

  ]
}

Update a Verification Status

Request

curl "https://verify.somleng.org/v2/Services/6ca68b71-bfea-4ec9-91a9-5245cf633ff5/Verifications/57b101e8-886b-4d15-bde0-c9cedd5d19e9" -d 'Status=approved' -X POST \
    -u 8767824a-4c63-4c4f-a11c-24b0a4eb6a5c:UDR_SVeC8f5f30UHEk976eWbDy0G85SjHWJN6aX2KwU \
    -H "Content-Type: application/x-www-form-urlencoded"

Endpoint

POST https://verify.somleng.org/v2/Services/:service_sid/Verifications/:sid

POST https://verify.somleng.org/v2/Services/6ca68b71-bfea-4ec9-91a9-5245cf633ff5/Verifications/57b101e8-886b-4d15-bde0-c9cedd5d19e9

Parameters

Status=approved
Name Description
ServiceSid required The SID of the verification Service to create the resource under.
Sid required The SID of the Verification resource to update.
To required The phone number or email to verify. Phone numbers must be in E.164 format.
Status required The new status of the resource. Can be: canceled or approved.

Response


200 OK
{
  "sid": "57b101e8-886b-4d15-bde0-c9cedd5d19e9",
  "account_sid": "8767824a-4c63-4c4f-a11c-24b0a4eb6a5c",
  "date_created": "2024-02-23T10:04:35Z",
  "date_updated": "2024-02-23T10:04:35Z",
  "service_sid": "6ca68b71-bfea-4ec9-91a9-5245cf633ff5",
  "to": "+85512334667",
  "channel": "sms",
  "status": "approved",
  "url": "http://verify.lvh.me/v2/Services/6ca68b71-bfea-4ec9-91a9-5245cf633ff5/Verifications/57b101e8-886b-4d15-bde0-c9cedd5d19e9",
  "send_code_attempts": [

  ]
}

Check a Verification with a Phone Number

Request

curl "https://verify.somleng.org/v2/Services/7eed5038-b161-445b-a046-6652895ae472/VerificationCheck" -d 'To=%2B85512334667&Code=1234' -X POST \
    -u 5b158f18-06ce-49e4-ab3e-7d40a1b5235d:zsMVF4zqM1j4nkZd0E_hc73gzeATf8uUgPqjGIBm1rA \
    -H "Content-Type: application/x-www-form-urlencoded"

Endpoint

POST https://verify.somleng.org/v2/Services/:service_sid/VerificationCheck

POST https://verify.somleng.org/v2/Services/7eed5038-b161-445b-a046-6652895ae472/VerificationCheck

Parameters

To=%2B85512334667&Code=1234
Name Description
ServiceSid required The SID of the verification Service to create the resource under.
Code The 4-10 character string being verified.
To The phone number or email to verify. Either this parameter or the verification_sid` must be specified. Phone numbers must be in E.164 format.
VerificationSid A SID that uniquely identifies the Verification. Either this parameter or the To phone number/email must be specified.

Response


200 OK
{
  "sid": "ec37d02f-26f3-4763-ac84-12bfc28bf9c4",
  "account_sid": "5b158f18-06ce-49e4-ab3e-7d40a1b5235d",
  "date_created": "2024-02-23T10:04:36Z",
  "date_updated": "2024-02-23T10:04:36Z",
  "service_sid": "7eed5038-b161-445b-a046-6652895ae472",
  "to": "+85512334667",
  "channel": "sms",
  "status": "approved"
}

Check a Verification with a SID

Request

curl "https://verify.somleng.org/v2/Services/03d14034-5503-4deb-9249-634b6fca64a7/VerificationCheck" -d 'VerificationSid=5ac03341-cf4d-43dd-8eea-4654bf663a68&Code=1234' -X POST \
    -u b0b05bd8-40e9-4580-949d-f0ce5c0220a3:srGbLMlvhwDbzvn7Pu5DzxnYq4P5E5XCj4Z7_a_kqXM \
    -H "Content-Type: application/x-www-form-urlencoded"

Endpoint

POST https://verify.somleng.org/v2/Services/:service_sid/VerificationCheck

POST https://verify.somleng.org/v2/Services/03d14034-5503-4deb-9249-634b6fca64a7/VerificationCheck

Parameters

VerificationSid=5ac03341-cf4d-43dd-8eea-4654bf663a68&Code=1234
Name Description
ServiceSid required The SID of the verification Service to create the resource under.
Code The 4-10 character string being verified.
To The phone number or email to verify. Either this parameter or the verification_sid` must be specified. Phone numbers must be in E.164 format.
VerificationSid A SID that uniquely identifies the Verification. Either this parameter or the To phone number/email must be specified.

Response


200 OK
{
  "sid": "5ac03341-cf4d-43dd-8eea-4654bf663a68",
  "account_sid": "b0b05bd8-40e9-4580-949d-f0ce5c0220a3",
  "date_created": "2024-02-23T10:04:36Z",
  "date_updated": "2024-02-23T10:04:36Z",
  "service_sid": "03d14034-5503-4deb-9249-634b6fca64a7",
  "to": "+85512334667",
  "channel": "sms",
  "status": "approved"
}