NAV
cURL

This is the API Documentation for Somleng Simple Call Flow Manager (Somleng SCFM).

Access Tokens

Create an Access Token

Request

curl "https://scfm.somleng.org/api/access_tokens" -d '{
  "metadata": {
    "foo": "bar"
  },
  "permissions": [
    "contacts_write"
  ]
}' -X POST \
    -H "Authorization: Bearer AYOtBvnbwwTVM9VrraMMdtzNL1BtjF1xW0dy7v6UZlI"

Endpoint

POST /api/access_tokens

POST /api/access_tokens

Parameters

{
  "metadata": {
    "foo": "bar"
  },
  "permissions": [
    "contacts_write"
  ]
}
Name Description
permissions An array of permissions for the access token. Valid permissions are: access_tokens_read, access_tokens_write, accounts_read, accounts_write, batch_operations_read, batch_operations_write, callout_participations_read, callout_participations_write, callouts_read, callouts_write, contacts_read, contacts_write, phone_calls_read, phone_calls_write, remote_phone_call_events_read, remote_phone_call_events_write, users_read, users_write

Response

Location: /api/access_tokens/16
201 Created
{
  "id": 16,
  "token": "bIc8JWpDzcwO67eb9cO3jRgfRoB6U-1wW844h2WR0vA",
  "created_at": "2020-08-05T00:20:56.644Z",
  "updated_at": "2020-08-05T00:20:56.646Z",
  "metadata": {
    "foo": "bar"
  },
  "permissions": [
    "contacts_write"
  ]
}

Delete an Access Token

Request

curl "https://scfm.somleng.org/api/access_tokens/21" -d '' -X DELETE \
    -H "Authorization: Bearer IPfZBTdw3Tj8DU--D6kSLzmGvXgA-0K4HgOb6kxZSeE"

Endpoint

DELETE /api/access_tokens/:id

DELETE /api/access_tokens/21

Parameters

None known.

Response

Location: /api/access_tokens
204 No Content

List all Access Tokens

Request

curl -g "https://scfm.somleng.org/api/access_tokens?q[metadata][foo]=bar" -X GET \
    -H "Authorization: Bearer 8sC4eNSzDNWXxvHa5w-v5Kah_QUOJZyIyM78sA-jRrY"

Endpoint

GET /api/access_tokens

GET /api/access_tokens?q[metadata][foo]=bar

Parameters

q: {"metadata"=>{"foo"=>"bar"}}
Name Description
q A filter in which to filter resources

Response

Per-Page: 25
Total: 1
200 OK
[
  {
    "id": 11,
    "token": "pZxfyMm9qHixM_KeB5rL7kSr08OkH73LI1Te8qjUU5o",
    "created_at": "2020-08-05T00:20:56.536Z",
    "updated_at": "2020-08-05T00:20:56.538Z",
    "metadata": {
      "foo": "bar"
    },
    "permissions": [

    ]
  }
]

Retrieve an Access Token

Request

curl -g "https://scfm.somleng.org/api/access_tokens/19" -X GET \
    -H "Authorization: Bearer XSEnwvucTNdPNzcoV103xvLfu5hwekUIX1nHSLBPAbQ"

Endpoint

GET /api/access_tokens/:id

GET /api/access_tokens/19

Parameters

None known.

Response

Location: /api/access_tokens/19
200 OK
{
  "id": 19,
  "token": "XSEnwvucTNdPNzcoV103xvLfu5hwekUIX1nHSLBPAbQ",
  "created_at": "2020-08-05T00:20:56.691Z",
  "updated_at": "2020-08-05T00:20:56.693Z",
  "metadata": {
  },
  "permissions": [
    "access_tokens_read",
    "access_tokens_write"
  ]
}

Update an Access Token

Request

curl "https://scfm.somleng.orgapi/access_tokens/20" -d '{
  "metadata": {
    "foo": "bar"
  },
  "metadata_merge_mode": "replace"
}' -X PATCH \
    -H "Authorization: Bearer vAyGXkyhHceFTEmHX_ImKzPpXeCHjg-yM-uYC8drQFI"

Endpoint

PATCH api/access_tokens/:id

PATCH api/access_tokens/20

Parameters

{
  "metadata": {
    "foo": "bar"
  },
  "metadata_merge_mode": "replace"
}

None known.

Response

Location: /api/access_tokens/20
204 No Content

Account Details

Retrieve Account Details

Request

curl -g "https://scfm.somleng.org/api/account" -X GET \
    -H "Authorization: Bearer FGicyFllpLEm7u0nbijk_YYUSZUxNes3SgBhsQo3LWg"

Endpoint

GET /api/account

GET /api/account

Parameters

None known.

Response

Location: /api/accounts/513
200 OK
{
  "id": 513,
  "metadata": {
  },
  "settings": {
  },
  "twilio_account_sid": null,
  "somleng_account_sid": null,
  "twilio_auth_token": null,
  "somleng_auth_token": null,
  "permissions": [

  ],
  "created_at": "2020-08-05T00:20:56.786Z",
  "updated_at": "2020-08-05T00:20:56.786Z",
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "platform_provider_name": null,
  "somleng_api_host": null,
  "somleng_api_base_url": null
}

Update Account Details

Request

curl "https://scfm.somleng.org/api/account" -d '{
  "metadata": {
    "foo": "bar"
  },
  "metadata_merge_mode": "replace"
}' -X PATCH \
    -H "Authorization: Bearer eFTYCLt1KaajFxq6kG1GwS0noco2wdRGamCw1H2FL-g"

Endpoint

PATCH /api/account

PATCH /api/account

Parameters

{
  "metadata": {
    "foo": "bar"
  },
  "metadata_merge_mode": "replace"
}

None known.

Response

Location: /api/accounts/514
204 No Content

Accounts

Only super admins can manage accounts.

Create an Account

Request

curl "https://scfm.somleng.org/api/accounts" -d '' -X POST \
    -H "Authorization: Bearer l_exmGObuMS1bwkqCu4ERHlOGVwfThWAKEYkbA8bwn4"

Endpoint

POST /api/accounts

POST /api/accounts

Parameters

None known.

Response

Location: /api/accounts/519
201 Created
{
  "id": 519,
  "metadata": {
  },
  "settings": {
  },
  "twilio_account_sid": null,
  "somleng_account_sid": null,
  "twilio_auth_token": null,
  "somleng_auth_token": null,
  "permissions": [

  ],
  "created_at": "2020-08-05T00:20:56.886Z",
  "updated_at": "2020-08-05T00:20:56.886Z",
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "platform_provider_name": null,
  "somleng_api_host": null,
  "somleng_api_base_url": null
}

Delete an Account

Request

curl "https://scfm.somleng.org/api/accounts/524" -d '' -X DELETE \
    -H "Authorization: Bearer yYqgdwyOasPi-epVNu1WQGeGT71qTiTPLr1WQkzQVjE"

Endpoint

DELETE /api/accounts/:id

DELETE /api/accounts/524

Parameters

None known.

Response

Location: /api/accounts
204 No Content

List all Accounts

Request

curl -g "https://scfm.somleng.org/api/accounts?q[metadata][foo]=bar" -X GET \
    -H "Authorization: Bearer NLsXVFFOkglazZmKg1dMTMIls-WtRkP4tTQOEPK6iXI"

Endpoint

GET /api/accounts

GET /api/accounts?q[metadata][foo]=bar

Parameters

q: {"metadata"=>{"foo"=>"bar"}}

None known.

Response

Per-Page: 25
Total: 1
200 OK
[
  {
    "id": 515,
    "metadata": {
      "foo": "bar"
    },
    "settings": {
    },
    "twilio_account_sid": null,
    "somleng_account_sid": null,
    "twilio_auth_token": null,
    "somleng_auth_token": null,
    "permissions": [

    ],
    "created_at": "2020-08-05T00:20:56.827Z",
    "updated_at": "2020-08-05T00:20:56.827Z",
    "call_flow_logic": "CallFlowLogic::HelloWorld",
    "platform_provider_name": null,
    "somleng_api_host": null,
    "somleng_api_base_url": null
  }
]

Retrieve an Account

Request

curl -g "https://scfm.somleng.org/api/accounts/520" -X GET \
    -H "Authorization: Bearer LqKr5gLGtsoag11_6_jeSgCpL0WtzpTNkSvjFdnL9Xk"

Endpoint

GET /api/accounts/:id

GET /api/accounts/520

Parameters

None known.

Response

Location: /api/accounts/520
200 OK
{
  "id": 520,
  "metadata": {
  },
  "settings": {
  },
  "twilio_account_sid": null,
  "somleng_account_sid": null,
  "twilio_auth_token": null,
  "somleng_auth_token": null,
  "permissions": [

  ],
  "created_at": "2020-08-05T00:20:56.894Z",
  "updated_at": "2020-08-05T00:20:56.894Z",
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "platform_provider_name": null,
  "somleng_api_host": null,
  "somleng_api_base_url": null
}

Update an Account

Request

curl "https://scfm.somleng.org/api/accounts/522" -d '{
  "metadata": {
    "foo": "bar"
  },
  "metadata_merge_mode": "replace",
  "twilio_account_sid": "AC9",
  "somleng_account_sid": "b91465e9-d739-49c6-a89c-4eaf5b9c283a",
  "twilio_auth_token": "61cd7938-453a-4c19-a32a-bc13ab85db1c",
  "somleng_auth_token": "b8acc8b6-26be-4e92-bc83-2cceaca8d928",
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "platform_provider_name": "somleng",
  "settings": {
    "batch_operation_phone_call_create_parameters": {
      "callout_filter_params": {
        "status": "running"
      },
      "callout_participation_filter_params": {
        "no_phone_calls_or_last_attempt": "failed"
      },
      "remote_request_params": {
        "from": "1234",
        "url": "https://demo.twilio.com/docs/voice.xml",
        "method": "GET"
      }
    },
    "batch_operation_phone_call_queue_parameters": {
      "callout_filter_params": {
        "status": "running"
      },
      "phone_call_filter_params": {
        "status": "created"
      },
      "limit": "30"
    },
    "batch_operation_phone_call_queue_remote_fetch_parameters": {
      "phone_call_filter_params": {
        "status": "remotely_queued,in_progress"
      },
      "limit": "30"
    }
  }
}' -X PATCH \
    -H "Authorization: Bearer 54yFXyqX_GCAiAXwBUCmHlUcwXrXhRdKC1yIekJ4Ryc"

Endpoint

PATCH /api/accounts/:id

PATCH /api/accounts/522

Parameters

{
  "metadata": {
    "foo": "bar"
  },
  "metadata_merge_mode": "replace",
  "twilio_account_sid": "AC9",
  "somleng_account_sid": "b91465e9-d739-49c6-a89c-4eaf5b9c283a",
  "twilio_auth_token": "61cd7938-453a-4c19-a32a-bc13ab85db1c",
  "somleng_auth_token": "b8acc8b6-26be-4e92-bc83-2cceaca8d928",
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "platform_provider_name": "somleng",
  "settings": {
    "batch_operation_phone_call_create_parameters": {
      "callout_filter_params": {
        "status": "running"
      },
      "callout_participation_filter_params": {
        "no_phone_calls_or_last_attempt": "failed"
      },
      "remote_request_params": {
        "from": "1234",
        "url": "https://demo.twilio.com/docs/voice.xml",
        "method": "GET"
      }
    },
    "batch_operation_phone_call_queue_parameters": {
      "callout_filter_params": {
        "status": "running"
      },
      "phone_call_filter_params": {
        "status": "created"
      },
      "limit": "30"
    },
    "batch_operation_phone_call_queue_remote_fetch_parameters": {
      "phone_call_filter_params": {
        "status": "remotely_queued,in_progress"
      },
      "limit": "30"
    }
  }
}

None known.

Response

Location: /api/accounts/522
204 No Content

Batch Operations

Create Phone Calls

Create a batch operation for creating phone calls. Specify remote_request_params to provide the request parameters for the phone call. You can filter which phone calls will be created using callout_filter_params, contact_filter_params and callout_participation_filter_params.

Request

curl "https://scfm.somleng.org/api/batch_operations" -d '{
  "metadata": {
    "foo": "bar"
  },
  "parameters": {
    "skip_validate_preview_presence": "1",
    "remote_request_params": {
      "url": "https://scfm.somleng.org/api/remote_phone_call_events",
      "from": "1234",
      "status_callback": "https://scfm.somleng.org/api/remote_phone_call_events"
    },
    "callout_filter_params": {
      "status": "running"
    },
    "callout_participation_filter_params": {
      "having_max_phone_calls_count": 3,
      "no_phone_calls_or_last_attempt": "not_answered,busy,failed"
    },
    "limit": 20
  },
  "type": "BatchOperation::PhoneCallCreate"
}' -X POST \
    -H "Authorization: Bearer _z61PWxKQqeDRqLOfAlEQgEwFAhCer26wM3rzl2pEOE"

Endpoint

POST /api/batch_operations

POST /api/batch_operations

Parameters

{
  "metadata": {
    "foo": "bar"
  },
  "parameters": {
    "skip_validate_preview_presence": "1",
    "remote_request_params": {
      "url": "https://scfm.somleng.org/api/remote_phone_call_events",
      "from": "1234",
      "status_callback": "https://scfm.somleng.org/api/remote_phone_call_events"
    },
    "callout_filter_params": {
      "status": "running"
    },
    "callout_participation_filter_params": {
      "having_max_phone_calls_count": 3,
      "no_phone_calls_or_last_attempt": "not_answered,busy,failed"
    },
    "limit": 20
  },
  "type": "BatchOperation::PhoneCallCreate"
}
Name Description
type required One of: BatchOperation::CalloutPopulation, BatchOperation::PhoneCallCreate, BatchOperation::PhoneCallQueue, BatchOperation::PhoneCallQueueRemoteFetch
parameters Parameters for the batch operation. limit, specifies a limit to the number of operations that will occur in the batch operation. skip_validate_preview_presence turns off validation for creating batch operations which would not effect any resources
callout_id The id of the callout. Only applicable if the type is BatchOperation::CalloutPopulation

Response

Location: /api/batch_operations/73
201 Created
{
  "id": 73,
  "callout_id": null,
  "parameters": {
    "skip_validate_preview_presence": "1",
    "remote_request_params": {
      "url": "https://scfm.somleng.org/api/remote_phone_call_events",
      "from": "1234",
      "status_callback": "https://scfm.somleng.org/api/remote_phone_call_events"
    },
    "callout_filter_params": {
      "status": "running"
    },
    "callout_participation_filter_params": {
      "having_max_phone_calls_count": 3,
      "no_phone_calls_or_last_attempt": "not_answered,busy,failed"
    },
    "limit": 20
  },
  "metadata": {
    "foo": "bar"
  },
  "status": "preview",
  "created_at": "2020-08-05T00:20:57.152Z",
  "updated_at": "2020-08-05T00:20:57.152Z",
  "account_id": 531,
  "type": "BatchOperation::PhoneCallCreate"
}

Create a Batch Operation Event

Request

curl "https://scfm.somleng.org/api/batch_operations/80/batch_operation_events" -d '{
  "event": "queue"
}' -X POST \
    -H "Authorization: Bearer 9C6AvO9GGn8VDt3aX8DEpyRKbwQ4XlZnRJE0w6til64"

Endpoint

POST /api/batch_operations/:batch_operation_id/batch_operation_events

POST /api/batch_operations/80/batch_operation_events

Parameters

{
  "event": "queue"
}
Name Description
event required Either queue or requeue.

Response

Location: /api/batch_operations/80
201 Created
{
  "id": 80,
  "callout_id": 249,
  "parameters": {
  },
  "metadata": {
  },
  "status": "queued",
  "created_at": "2020-08-05T00:20:57.373Z",
  "updated_at": "2020-08-05T00:20:57.373Z",
  "account_id": 541,
  "type": "BatchOperation::CalloutPopulation"
}

Delete a Batch Operation

Request

curl "https://scfm.somleng.org/api/batch_operations/78" -d '' -X DELETE \
    -H "Authorization: Bearer v3eew1jUihscRvla3KEOsKNUjuWwY3adTdcvtjf6nu0"

Endpoint

DELETE /api/batch_operations/:id

DELETE /api/batch_operations/78

Parameters

None known.

Response

Location: /api/batch_operations
204 No Content

List all Batch Operations

Request

curl -g "https://scfm.somleng.org/api/batch_operations?q[metadata][foo]=bar" -X GET \
    -H "Authorization: Bearer NdGzWai2yCpJyeCHe0MZFWo9VxpJTxnNSlZZet62pyc"

Endpoint

GET /api/batch_operations

GET /api/batch_operations?q[metadata][foo]=bar

Parameters

q: {"metadata"=>{"foo"=>"bar"}}

None known.

Response

Per-Page: 25
Total: 1
200 OK
[
  {
    "id": 69,
    "callout_id": 240,
    "parameters": {
    },
    "metadata": {
      "foo": "bar"
    },
    "status": "preview",
    "created_at": "2020-08-05T00:20:57.064Z",
    "updated_at": "2020-08-05T00:20:57.064Z",
    "account_id": 528,
    "type": "BatchOperation::CalloutPopulation"
  }
]

Populate a Callout

Creates a batch operation for populating a callout with callout participations. Specify contact_filter_params in order to filter which contacts will participate in the callout.

Request

curl "https://scfm.somleng.org/api/batch_operations" -d '{
  "callout_id": 243,
  "metadata": {
    "foo": "bar"
  },
  "parameters": {
    "skip_validate_preview_presence": "1",
    "contact_filter_params": {
      "metadata": {
        "gender": "f"
      }
    }
  },
  "type": "BatchOperation::CalloutPopulation"
}' -X POST \
    -H "Authorization: Bearer UB1lR7PU5ZE8xvvCd6TwjKKhQBZV4Ao2BIE1tLWuOjk"

Endpoint

POST /api/batch_operations

POST /api/batch_operations

Parameters

{
  "callout_id": 243,
  "metadata": {
    "foo": "bar"
  },
  "parameters": {
    "skip_validate_preview_presence": "1",
    "contact_filter_params": {
      "metadata": {
        "gender": "f"
      }
    }
  },
  "type": "BatchOperation::CalloutPopulation"
}
Name Description
type required One of: BatchOperation::CalloutPopulation, BatchOperation::PhoneCallCreate, BatchOperation::PhoneCallQueue, BatchOperation::PhoneCallQueueRemoteFetch
parameters Parameters for the batch operation. limit, specifies a limit to the number of operations that will occur in the batch operation. skip_validate_preview_presence turns off validation for creating batch operations which would not effect any resources
callout_id The id of the callout. Only applicable if the type is BatchOperation::CalloutPopulation

Response

Location: /api/batch_operations/72
201 Created
{
  "id": 72,
  "callout_id": 243,
  "parameters": {
    "skip_validate_preview_presence": "1",
    "contact_filter_params": {
      "metadata": {
        "gender": "f"
      }
    }
  },
  "metadata": {
    "foo": "bar"
  },
  "status": "preview",
  "created_at": "2020-08-05T00:20:57.126Z",
  "updated_at": "2020-08-05T00:20:57.126Z",
  "account_id": 530,
  "type": "BatchOperation::CalloutPopulation"
}

Preview a Batch Operation

Previews a Batch Operation. For example, you can preview a CalloutPopulation batch operation for which contacts will participate in a callout.

Request

curl -g "https://scfm.somleng.org/api/batch_operations/85/preview/contacts" -X GET \
    -H "Authorization: Bearer 8281RkCeFJYOznerX7okldZLbE3jNyn0DkWibMfJNQ4"

Endpoint

GET /api/batch_operations/:batch_operation_id/preview/contacts

GET /api/batch_operations/85/preview/contacts

Parameters

None known.

Response

Per-Page: 25
Total: 1
200 OK
[
  {
    "id": 231,
    "msisdn": "+252662345985",
    "metadata": {
      "foo": "bar"
    },
    "created_at": "2020-08-05T00:20:57.656Z",
    "updated_at": "2020-08-05T00:20:57.656Z",
    "account_id": 546
  }
]

Queue Phone Calls

Create a batch operation for queuing phone calls to Somleng or Twilio. You can filter which phone calls will be queued using phone_call_filter_params, contact_filter_params, callout_participation_filter_params and callout_filter_params.

Request

curl "https://scfm.somleng.org/api/batch_operations" -d '{
  "metadata": {
    "foo": "bar"
  },
  "parameters": {
    "skip_validate_preview_presence": "1",
    "callout_filter_params": {
      "status": "running"
    },
    "phone_call_filter_params": {
      "status": "created"
    },
    "limit": 20
  },
  "type": "BatchOperation::PhoneCallQueue"
}' -X POST \
    -H "Authorization: Bearer tkutEs0_U-jtweyKO2p60hBAtkza5Ic6uYe3BPT9-ZE"

Endpoint

POST /api/batch_operations

POST /api/batch_operations

Parameters

{
  "metadata": {
    "foo": "bar"
  },
  "parameters": {
    "skip_validate_preview_presence": "1",
    "callout_filter_params": {
      "status": "running"
    },
    "phone_call_filter_params": {
      "status": "created"
    },
    "limit": 20
  },
  "type": "BatchOperation::PhoneCallQueue"
}
Name Description
type required One of: BatchOperation::CalloutPopulation, BatchOperation::PhoneCallCreate, BatchOperation::PhoneCallQueue, BatchOperation::PhoneCallQueueRemoteFetch
parameters Parameters for the batch operation. limit, specifies a limit to the number of operations that will occur in the batch operation. skip_validate_preview_presence turns off validation for creating batch operations which would not effect any resources
callout_id The id of the callout. Only applicable if the type is BatchOperation::CalloutPopulation

Response

Location: /api/batch_operations/74
201 Created
{
  "id": 74,
  "callout_id": null,
  "parameters": {
    "skip_validate_preview_presence": "1",
    "callout_filter_params": {
      "status": "running"
    },
    "phone_call_filter_params": {
      "status": "created"
    },
    "limit": 20
  },
  "metadata": {
    "foo": "bar"
  },
  "status": "preview",
  "created_at": "2020-08-05T00:20:57.178Z",
  "updated_at": "2020-08-05T00:20:57.178Z",
  "account_id": 532,
  "type": "BatchOperation::PhoneCallQueue"
}

Queue Remote Status Fetch

Create a batch operation for fetching the remote status of calls on Somleng or Twilio. You can filter which phone calls will be fetched using phone_call_filter_params, contact_filter_params, callout_participation_filter_params and callout_filter_params.

Request

curl "https://scfm.somleng.org/api/batch_operations" -d '{
  "metadata": {
    "foo": "bar"
  },
  "parameters": {
    "skip_validate_preview_presence": "1",
    "callout_filter_params": {
      "status": "running"
    },
    "phone_call_filter_params": {
      "status": "remotely_queued,in_progress"
    },
    "limit": 200
  },
  "type": "BatchOperation::PhoneCallQueueRemoteFetch"
}' -X POST \
    -H "Authorization: Bearer SlqcQI7AkHjL6DTEUYRZyFYExQHs7I46GkpLYliBoFc"

Endpoint

POST /api/batch_operations

POST /api/batch_operations

Parameters

{
  "metadata": {
    "foo": "bar"
  },
  "parameters": {
    "skip_validate_preview_presence": "1",
    "callout_filter_params": {
      "status": "running"
    },
    "phone_call_filter_params": {
      "status": "remotely_queued,in_progress"
    },
    "limit": 200
  },
  "type": "BatchOperation::PhoneCallQueueRemoteFetch"
}
Name Description
type required One of: BatchOperation::CalloutPopulation, BatchOperation::PhoneCallCreate, BatchOperation::PhoneCallQueue, BatchOperation::PhoneCallQueueRemoteFetch
parameters Parameters for the batch operation. limit, specifies a limit to the number of operations that will occur in the batch operation. skip_validate_preview_presence turns off validation for creating batch operations which would not effect any resources
callout_id The id of the callout. Only applicable if the type is BatchOperation::CalloutPopulation

Response

Location: /api/batch_operations/75
201 Created
{
  "id": 75,
  "callout_id": null,
  "parameters": {
    "skip_validate_preview_presence": "1",
    "callout_filter_params": {
      "status": "running"
    },
    "phone_call_filter_params": {
      "status": "remotely_queued,in_progress"
    },
    "limit": 200
  },
  "metadata": {
    "foo": "bar"
  },
  "status": "preview",
  "created_at": "2020-08-05T00:20:57.204Z",
  "updated_at": "2020-08-05T00:20:57.204Z",
  "account_id": 533,
  "type": "BatchOperation::PhoneCallQueueRemoteFetch"
}

Retrieve a Batch Operation

Request

curl -g "https://scfm.somleng.org/api/batch_operations/76" -X GET \
    -H "Authorization: Bearer j0tp66ia59oM81eCgtTT7PiF_yxDgmULzaFXP42z2Us"

Endpoint

GET /api/batch_operations/:id

GET /api/batch_operations/76

Parameters

None known.

Response

Location: /api/batch_operations/76
200 OK
{
  "id": 76,
  "callout_id": 244,
  "parameters": {
  },
  "metadata": {
  },
  "status": "preview",
  "created_at": "2020-08-05T00:20:57.243Z",
  "updated_at": "2020-08-05T00:20:57.243Z",
  "account_id": 535,
  "type": "BatchOperation::CalloutPopulation"
}

Update a Batch Operation

Request

curl "https://scfm.somleng.org/api/batch_operations/77" -d '{
  "metadata": {
    "foo": "bar",
    "bar": "foo"
  },
  "parameters": {
    "skip_validate_preview_presence": "1",
    "foo": "bar"
  },
  "metadata_merge_mode": "replace"
}' -X PATCH \
    -H "Authorization: Bearer Y3dzEcgDuemZs6zTtbPsppgGJgP3Z8wCNkbVFg3f6Xk"

Endpoint

PATCH /api/batch_operations/:id

PATCH /api/batch_operations/77

Parameters

{
  "metadata": {
    "foo": "bar",
    "bar": "foo"
  },
  "parameters": {
    "skip_validate_preview_presence": "1",
    "foo": "bar"
  },
  "metadata_merge_mode": "replace"
}

None known.

Response

Location: /api/batch_operations/77
204 No Content

Callout Participations

Create a Callout Participation

Request

curl "https://scfm.somleng.org/api/callouts/275/callout_participations" -d '{
  "contact_id": 252,
  "msisdn": "252662346007",
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "metadata": {
    "foo": "bar"
  }
}' -X POST \
    -H "Authorization: Bearer z_6Rip-FyBDAexgYm3nWBL8GRRa2I_gpeP1y5Hu98sw"

Endpoint

POST /api/callouts/:callout_id/callout_participations

POST /api/callouts/275/callout_participations

Parameters

{
  "contact_id": 252,
  "msisdn": "252662346007",
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "metadata": {
    "foo": "bar"
  }
}

None known.

Response

Location: /api/callout_participations/228
201 Created
{
  "id": 228,
  "callout_id": 275,
  "contact_id": 252,
  "callout_population_id": null,
  "msisdn": "+252662346007",
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "metadata": {
    "foo": "bar"
  },
  "created_at": "2020-08-05T00:20:58.287Z",
  "updated_at": "2020-08-05T00:20:58.287Z"
}

Create a Callout Participation with invalid data

Request

curl "https://scfm.somleng.org/api/callouts/276/callout_participations" -d '' -X POST \
    -H "Authorization: Bearer m77cMZy8WoQ1MddF-y28dJFDyXARy070udjxmHnVS3g"

Endpoint

POST /api/callouts/:callout_id/callout_participations

POST /api/callouts/276/callout_participations

Parameters

None known.

Response


422 Unprocessable Entity
{
  "errors": {
    "msisdn": [
      "can't be blank"
    ],
    "contact": [
      "must exist"
    ]
  }
}

Delete a Callout Participation

Request

curl "https://scfm.somleng.org/api/callout_participations/231" -d '' -X DELETE \
    -H "Authorization: Bearer g17xRakh4qtOLyR3qkqq-addIxKCKbwbVXfGrJeXPpk"

Endpoint

DELETE /api/callout_participations/:id

DELETE /api/callout_participations/231

Parameters

None known.

Response

Location: /api/callout_participations
204 No Content

Delete a Callout Participation with phone calls

Request

curl "https://scfm.somleng.org/api/callout_participations/232" -d '' -X DELETE \
    -H "Authorization: Bearer FvgpH7myrX5umrwhq88DdVonCD1rBWyax_Jguw_XK0o"

Endpoint

DELETE /api/callout_participations/:id

DELETE /api/callout_participations/232

Parameters

None known.

Response


422 Unprocessable Entity
{
  "errors": {
    "base": [
      "Cannot delete record because dependent phone calls exist"
    ]
  }
}

List all Callout Participations

Request

curl -g "https://scfm.somleng.org/api/callout_participations?q[metadata][foo]=bar&q[having_max_phone_calls_count]=1" -X GET \
    -H "Authorization: Bearer enI9caHt-IMZa8Nm6RbMImosZFNxy4_9tVP4YNI31Ds"

Endpoint

GET /api/callout_participations

GET /api/callout_participations?q[metadata][foo]=bar&q[having_max_phone_calls_count]=1

Parameters

q: {"metadata"=>{"foo"=>"bar"}, "having_max_phone_calls_count"=>"1"}

None known.

Response

Per-Page: 25
Total: 1
200 OK
[
  {
    "id": 217,
    "callout_id": 263,
    "contact_id": 241,
    "callout_population_id": null,
    "msisdn": "+252662345995",
    "call_flow_logic": "CallFlowLogic::HelloWorld",
    "metadata": {
      "foo": "bar"
    },
    "created_at": "2020-08-05T00:20:57.960Z",
    "updated_at": "2020-08-05T00:20:57.960Z"
  }
]

Retrieve a Callout Participation

Request

curl -g "https://scfm.somleng.org/api/callout_participations/229" -X GET \
    -H "Authorization: Bearer hSCEjRFft3JNKtIFw0cJPd82bdHC3sfXgMOs8cqjIig"

Endpoint

GET /api/callout_participations/:id

GET /api/callout_participations/229

Parameters

None known.

Response

Location: /api/callout_participations/229
200 OK
{
  "id": 229,
  "callout_id": 277,
  "contact_id": 253,
  "callout_population_id": null,
  "msisdn": "+252662346008",
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "metadata": {
  },
  "created_at": "2020-08-05T00:20:58.343Z",
  "updated_at": "2020-08-05T00:20:58.343Z"
}

Update a Callout Participation

Request

curl "https://scfm.somleng.org/api/callout_participations/230" -d '{
  "contact_id": 255,
  "msisdn": "252662346011",
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "metadata": {
    "bar": "foo"
  },
  "metadata_merge_mode": "replace"
}' -X PATCH \
    -H "Authorization: Bearer D24I5gKUKwatQmC2Kaddgf3hdvc93mSZqahiB9LmK7o"

Endpoint

PATCH /api/callout_participations/:id

PATCH /api/callout_participations/230

Parameters

{
  "contact_id": 255,
  "msisdn": "252662346011",
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "metadata": {
    "bar": "foo"
  },
  "metadata_merge_mode": "replace"
}

None known.

Response

Location: /api/callout_participations/230
204 No Content

Callouts

Create a Callout

Request

curl "https://scfm.somleng.org/api/callouts" -d '{
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "audio_url": "https://www.example.com/sample.mp3",
  "metadata": {
    "foo": "bar"
  },
  "settings": {
    "external_service_1": {
      "foo": "bar"
    }
  }
}' -X POST \
    -H "Authorization: Bearer TDNmlfoJvxkx3Hlvxt20M0OmiaoO9qNl9dZjhCXH45I"

Endpoint

POST /api/callouts

POST /api/callouts

Parameters

{
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "audio_url": "https://www.example.com/sample.mp3",
  "metadata": {
    "foo": "bar"
  },
  "settings": {
    "external_service_1": {
      "foo": "bar"
    }
  }
}
Name Description
call_flow_logic The name of the call flow logic to be run during the callout.
audio_url The URL to an audio file to be played during the callout.
settings Additionoal settings which are needed byt the call flow logic.

Response

Location: /api/callouts/286
201 Created
{
  "id": 286,
  "status": "initialized",
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "metadata": {
    "foo": "bar"
  },
  "created_at": "2020-08-05T00:20:58.591Z",
  "updated_at": "2020-08-05T00:20:58.591Z",
  "account_id": 567,
  "audio_url": "https://www.example.com/sample.mp3",
  "settings": {
    "external_service_1": {
      "foo": "bar"
    }
  },
  "created_by_id": null
}

Create a Callout Event

Request

curl "https://scfm.somleng.org/api/callouts/291/callout_events" -d '{
  "event": "start"
}' -X POST \
    -H "Authorization: Bearer dI8mLptY2UjzBfAea6mjGTnDVf4EpW9lLmDTpOVYFzk"

Endpoint

POST /api/callouts/:callout_id/callout_events

POST /api/callouts/291/callout_events

Parameters

{
  "event": "start"
}
Name Description
event required One of: start, pause, resume, stop

Response

Location: /api/callouts/291
201 Created
{
  "account_id": 572,
  "id": 291,
  "status": "running",
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "metadata": {
  },
  "created_at": "2020-08-05T00:20:58.713Z",
  "updated_at": "2020-08-05T00:20:58.734Z",
  "audio_url": null,
  "settings": {
  },
  "created_by_id": null
}

Delete a Callout

Request

curl "https://scfm.somleng.org/api/callouts/289" -d '' -X DELETE \
    -H "Authorization: Bearer eMStwsrRfQWclt_k5tkwiXM7TKA1X4XRdZ_BQGxbQD0"

Endpoint

DELETE /api/callouts/:id

DELETE /api/callouts/289

Parameters

None known.

Response

Location: /api/callouts
204 No Content

List all Callouts

Request

curl -g "https://scfm.somleng.org/api/callouts?q[metadata][foo]=bar" -X GET \
    -H "Authorization: Bearer DhQcMNrYgIzjJ5ntuEamDop3c3dHvzvMtGVXDyRw3Kc"

Endpoint

GET /api/callouts

GET /api/callouts?q[metadata][foo]=bar

Parameters

q: {"metadata"=>{"foo"=>"bar"}}

None known.

Response

Per-Page: 25
Total: 1
200 OK
[
  {
    "id": 281,
    "status": "initialized",
    "call_flow_logic": "CallFlowLogic::HelloWorld",
    "metadata": {
      "foo": "bar"
    },
    "created_at": "2020-08-05T00:20:58.495Z",
    "updated_at": "2020-08-05T00:20:58.495Z",
    "account_id": 564,
    "audio_url": null,
    "settings": {
    },
    "created_by_id": null
  }
]

Retrieve a Callout

Request

curl -g "https://scfm.somleng.org/api/callouts/287" -X GET \
    -H "Authorization: Bearer j8QeN3jJL1sD6xOz8NpENf-7_Ahi_ghzmdHR2qlyNbg"

Endpoint

GET /api/callouts/:id

GET /api/callouts/287

Parameters

None known.

Response

Location: /api/callouts/287
200 OK
{
  "id": 287,
  "status": "initialized",
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "metadata": {
  },
  "created_at": "2020-08-05T00:20:58.603Z",
  "updated_at": "2020-08-05T00:20:58.603Z",
  "account_id": 568,
  "audio_url": null,
  "settings": {
  },
  "created_by_id": null
}

Update a Callout

Request

curl "https://scfm.somleng.org/api/callouts/288" -d '{
  "metadata": {
    "bar": "foo"
  },
  "metadata_merge_mode": "replace"
}' -X PATCH \
    -H "Authorization: Bearer y2mlkA558Cw7zkO1Hpg1C0RjuBwDbEbZLug-XGPLPTo"

Endpoint

PATCH /api/callouts/:id

PATCH /api/callouts/288

Parameters

{
  "metadata": {
    "bar": "foo"
  },
  "metadata_merge_mode": "replace"
}

None known.

Response

Location: /api/callouts/288
204 No Content

Contacts

Create a Contact

Request

curl "https://scfm.somleng.org/api/contacts" -d '{
  "msisdn": "252662346025",
  "metadata": {
    "gender": "f",
    "name": "Kate"
  }
}' -X POST \
    -H "Authorization: Bearer Lm48iLayb1SQEEw1eKEy37wrviae1i7dN694x4hura8"

Endpoint

POST /api/contacts

POST /api/contacts

Parameters

{
  "msisdn": "252662346025",
  "metadata": {
    "gender": "f",
    "name": "Kate"
  }
}
Name Description
msisdn required Phone number in E.164 format

Response

Location: /api/contacts/269
201 Created
{
  "id": 269,
  "msisdn": "+252662346025",
  "metadata": {
    "gender": "f",
    "name": "Kate"
  },
  "created_at": "2020-08-05T00:20:58.982Z",
  "updated_at": "2020-08-05T00:20:58.982Z",
  "account_id": 580
}

Create or update a Contact

Creates or updates a contact. If a contact is found with the msisdn, it is updated, otherwise it is created.

Request

curl "https://scfm.somleng.org/api/contact_data" -d '{
  "msisdn": "252662346029",
  "metadata": {
    "gender": "f",
    "name": "Kate"
  }
}' -X POST \
    -H "Authorization: Bearer V66zKl_u7ovpX4OukfC4wufC26ecwnD__QkZ1hcWxKA"

Endpoint

POST /api/contact_data

POST /api/contact_data

Parameters

{
  "msisdn": "252662346029",
  "metadata": {
    "gender": "f",
    "name": "Kate"
  }
}

None known.

Response

Location: /api/contacts/273
201 Created
{
  "id": 273,
  "msisdn": "+252662346029",
  "metadata": {
    "gender": "f",
    "name": "Kate"
  },
  "created_at": "2020-08-05T00:20:59.122Z",
  "updated_at": "2020-08-05T00:20:59.122Z",
  "account_id": 585
}

Delete a Contact

Request

curl "https://scfm.somleng.org/api/contacts/275" -d '' -X DELETE \
    -H "Authorization: Bearer SfJSwOFC88oqyFUikQn7Wxoz9F_lvTIiynRQrRsSiZg"

Endpoint

DELETE /api/contacts/:id

DELETE /api/contacts/275

Parameters

None known.

Response

Location: /api/contacts
204 No Content

List all Contacts

Request

curl -g "https://scfm.somleng.org/api/contacts?q[metadata][foo]=bar" -X GET \
    -H "Authorization: Bearer 9ryNDszPnN_iZZDtXbzNE4k-w1TSKlJS-mhxdicXjXo"

Endpoint

GET /api/contacts

GET /api/contacts?q[metadata][foo]=bar

Parameters

q: {"metadata"=>{"foo"=>"bar"}}

None known.

Response

Per-Page: 25
Total: 1
200 OK
[
  {
    "id": 260,
    "msisdn": "+252662346016",
    "metadata": {
      "foo": "bar"
    },
    "created_at": "2020-08-05T00:20:58.800Z",
    "updated_at": "2020-08-05T00:20:58.800Z",
    "account_id": 575
  }
]

Retrieve a Contact

Request

curl -g "https://scfm.somleng.org/api/contacts/270" -X GET \
    -H "Authorization: Bearer UU11N5bUcLsL4UN-w-N87l8lYuIkYauJHxT7s-x-vpQ"

Endpoint

GET /api/contacts/:id

GET /api/contacts/270

Parameters

None known.

Response

Location: /api/contacts/270
200 OK
{
  "id": 270,
  "msisdn": "+252662346026",
  "metadata": {
  },
  "created_at": "2020-08-05T00:20:59.013Z",
  "updated_at": "2020-08-05T00:20:59.013Z",
  "account_id": 582
}

Update a Contact

Request

curl "https://scfm.somleng.org/api/contacts/271" -d '{
  "metadata": {
    "bar": "foo"
  },
  "metadata_merge_mode": "replace"
}' -X PATCH \
    -H "Authorization: Bearer VaPYBVy6KwuJ_JeGpsOAXYYWnHsSooXQXiHwiad4XmU"

Endpoint

PATCH /api/contacts/:id

PATCH /api/contacts/271

Parameters

{
  "metadata": {
    "bar": "foo"
  },
  "metadata_merge_mode": "replace"
}

None known.

Response

Location: /api/contacts/271
204 No Content

Phone Calls

Create a Phone Call

Request

curl "https://scfm.somleng.org/api/callout_participations/255/phone_calls" -d '{
  "msisdn": "252662346050",
  "remote_request_params": {
    "to": "to",
    "from": "from",
    "method": "method",
    "fallback_url": "fallback_url",
    "fallback_method": "fallback_method",
    "status_callback": "status_callback",
    "status_callback_event": "status_callback_event",
    "status_callback_method": "status_callback_method",
    "send_digits": "send_digits",
    "timeout": "timeout",
    "record": "record",
    "recording_channels": "recording_channels",
    "recording_status_callback": "recording_status_callback",
    "recording_status_callback_method": "recording_status_callback_method",
    "sip_auth_username": "sip_auth_username",
    "sip_auth_password": "sip_auth_password",
    "machine_detection": "machine_detection",
    "machine_detection_timeout": "machine_detection_timeout",
    "recording_status_callback_event": "recording_status_callback_event",
    "trim": "trim",
    "caller_id": "caller_id",
    "machine_detection_speech_threshold": "machine_detection_speech_threshold",
    "machine_detection_speech_end_threshold": "machine_detection_speech_end_threshold",
    "machine_detection_silence_timeout": "machine_detection_silence_timeout",
    "async_amd": "async_amd",
    "async_amd_status_callback": "async_amd_status_callback",
    "async_amd_status_callback_method": "async_amd_status_callback_method",
    "byoc": "byoc",
    "call_reason": "call_reason",
    "url": "url",
    "twiml": "twiml",
    "application_sid": "application_sid"
  },
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "metadata": {
    "foo": "bar"
  }
}' -X POST \
    -H "Authorization: Bearer xIQNR2V87tqfaRP_2OKvN_ARVNh82wBBYS1fG6RSrjE"

Endpoint

POST /api/callout_participations/:callout_participation_id/phone_calls

POST /api/callout_participations/255/phone_calls

Parameters

{
  "msisdn": "252662346050",
  "remote_request_params": {
    "to": "to",
    "from": "from",
    "method": "method",
    "fallback_url": "fallback_url",
    "fallback_method": "fallback_method",
    "status_callback": "status_callback",
    "status_callback_event": "status_callback_event",
    "status_callback_method": "status_callback_method",
    "send_digits": "send_digits",
    "timeout": "timeout",
    "record": "record",
    "recording_channels": "recording_channels",
    "recording_status_callback": "recording_status_callback",
    "recording_status_callback_method": "recording_status_callback_method",
    "sip_auth_username": "sip_auth_username",
    "sip_auth_password": "sip_auth_password",
    "machine_detection": "machine_detection",
    "machine_detection_timeout": "machine_detection_timeout",
    "recording_status_callback_event": "recording_status_callback_event",
    "trim": "trim",
    "caller_id": "caller_id",
    "machine_detection_speech_threshold": "machine_detection_speech_threshold",
    "machine_detection_speech_end_threshold": "machine_detection_speech_end_threshold",
    "machine_detection_silence_timeout": "machine_detection_silence_timeout",
    "async_amd": "async_amd",
    "async_amd_status_callback": "async_amd_status_callback",
    "async_amd_status_callback_method": "async_amd_status_callback_method",
    "byoc": "byoc",
    "call_reason": "call_reason",
    "url": "url",
    "twiml": "twiml",
    "application_sid": "application_sid"
  },
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "metadata": {
    "foo": "bar"
  }
}
Name Description
callout_participation_id required The id of the callout participation
remote_request_params required The request parameters to send to Somleng or Twilio

Response

Location: /api/phone_calls/216
201 Created
{
  "id": 216,
  "callout_participation_id": 255,
  "contact_id": 293,
  "create_batch_operation_id": null,
  "queue_batch_operation_id": null,
  "queue_remote_fetch_batch_operation_id": null,
  "status": "created",
  "msisdn": "+252662346050",
  "remote_call_id": null,
  "remote_status": null,
  "remote_direction": null,
  "remote_error_message": null,
  "metadata": {
    "foo": "bar"
  },
  "remote_response": {
  },
  "remote_request_params": {
    "to": "to",
    "from": "from",
    "method": "method",
    "fallback_url": "fallback_url",
    "fallback_method": "fallback_method",
    "status_callback": "status_callback",
    "status_callback_event": "status_callback_event",
    "status_callback_method": "status_callback_method",
    "send_digits": "send_digits",
    "timeout": "timeout",
    "record": "record",
    "recording_channels": "recording_channels",
    "recording_status_callback": "recording_status_callback",
    "recording_status_callback_method": "recording_status_callback_method",
    "sip_auth_username": "sip_auth_username",
    "sip_auth_password": "sip_auth_password",
    "machine_detection": "machine_detection",
    "machine_detection_timeout": "machine_detection_timeout",
    "recording_status_callback_event": "recording_status_callback_event",
    "trim": "trim",
    "caller_id": "caller_id",
    "machine_detection_speech_threshold": "machine_detection_speech_threshold",
    "machine_detection_speech_end_threshold": "machine_detection_speech_end_threshold",
    "machine_detection_silence_timeout": "machine_detection_silence_timeout",
    "async_amd": "async_amd",
    "async_amd_status_callback": "async_amd_status_callback",
    "async_amd_status_callback_method": "async_amd_status_callback_method",
    "byoc": "byoc",
    "call_reason": "call_reason",
    "url": "url",
    "twiml": "twiml",
    "application_sid": "application_sid"
  },
  "remote_queue_response": {
  },
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "remotely_queued_at": null,
  "created_at": "2020-08-05T00:20:59.824Z",
  "updated_at": "2020-08-05T00:20:59.824Z",
  "duration": 0,
  "lock_version": 0,
  "account_id": 598
}

Create a Phone Call Event

Queues a phone call, or a remote phone call status update on Somleng or Twilio

Request

curl "https://scfm.somleng.org/api/phone_calls/221/phone_call_events" -d '{
  "event": "queue"
}' -X POST \
    -H "Authorization: Bearer jQfiC8F0uIBAd81UOELfuSSIKvh5RRq3W20XkewTLa0"

Endpoint

POST /api/phone_calls/:phone_call_id/phone_call_events

POST /api/phone_calls/221/phone_call_events

Parameters

{
  "event": "queue"
}
Name Description
event required Either queue or queue_remote_fetch

Response

Location: /api/phone_calls/221
201 Created
{
  "account_id": 604,
  "id": 221,
  "callout_participation_id": 261,
  "contact_id": 299,
  "create_batch_operation_id": null,
  "queue_batch_operation_id": null,
  "queue_remote_fetch_batch_operation_id": null,
  "status": "queued",
  "msisdn": "+252662346058",
  "remote_call_id": null,
  "remote_status": null,
  "remote_direction": null,
  "remote_error_message": null,
  "metadata": {
  },
  "remote_response": {
  },
  "remote_request_params": {
    "to": "to",
    "url": "url",
    "byoc": "byoc",
    "from": "from",
    "trim": "trim",
    "twiml": "twiml",
    "method": "method",
    "record": "record",
    "timeout": "timeout",
    "async_amd": "async_amd",
    "caller_id": "caller_id",
    "call_reason": "call_reason",
    "send_digits": "send_digits",
    "fallback_url": "fallback_url",
    "application_sid": "application_sid",
    "fallback_method": "fallback_method",
    "status_callback": "status_callback",
    "machine_detection": "machine_detection",
    "sip_auth_password": "sip_auth_password",
    "sip_auth_username": "sip_auth_username",
    "recording_channels": "recording_channels",
    "status_callback_event": "status_callback_event",
    "status_callback_method": "status_callback_method",
    "async_amd_status_callback": "async_amd_status_callback",
    "machine_detection_timeout": "machine_detection_timeout",
    "recording_status_callback": "recording_status_callback",
    "recording_status_callback_event": "recording_status_callback_event",
    "async_amd_status_callback_method": "async_amd_status_callback_method",
    "recording_status_callback_method": "recording_status_callback_method",
    "machine_detection_silence_timeout": "machine_detection_silence_timeout",
    "machine_detection_speech_threshold": "machine_detection_speech_threshold",
    "machine_detection_speech_end_threshold": "machine_detection_speech_end_threshold"
  },
  "remote_queue_response": {
  },
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "remotely_queued_at": null,
  "created_at": "2020-08-05T00:21:00.078Z",
  "updated_at": "2020-08-05T00:21:00.106Z",
  "duration": 0,
  "lock_version": 1
}

Delete a Phone Call

Request

curl "https://scfm.somleng.org/api/phone_calls/219" -d '' -X DELETE \
    -H "Authorization: Bearer e0ywz9IwPFsAtYL1AoYkVRszOdR7xjvDD3hx3a_GrCc"

Endpoint

DELETE /api/phone_calls/:id

DELETE /api/phone_calls/219

Parameters

None known.

Response

Location: /api/phone_calls
204 No Content

List all Phone Calls

Request

curl -g "https://scfm.somleng.org/api/phone_calls?q[metadata][foo]=bar" -X GET \
    -H "Authorization: Bearer tdIN7pCueKMICIK0tjk7R0aCLb6YlF3DoX7RfJQrPmE"

Endpoint

GET /api/phone_calls

GET /api/phone_calls?q[metadata][foo]=bar

Parameters

q: {"metadata"=>{"foo"=>"bar"}}

None known.

Response

Per-Page: 25
Total: 1
200 OK
[
  {
    "id": 201,
    "callout_participation_id": 240,
    "contact_id": 278,
    "create_batch_operation_id": null,
    "queue_batch_operation_id": null,
    "queue_remote_fetch_batch_operation_id": null,
    "status": "created",
    "msisdn": "+252662346034",
    "remote_call_id": null,
    "remote_status": null,
    "remote_direction": null,
    "remote_error_message": null,
    "metadata": {
      "foo": "bar"
    },
    "remote_response": {
    },
    "remote_request_params": {
      "to": "to",
      "url": "url",
      "byoc": "byoc",
      "from": "from",
      "trim": "trim",
      "twiml": "twiml",
      "method": "method",
      "record": "record",
      "timeout": "timeout",
      "async_amd": "async_amd",
      "caller_id": "caller_id",
      "call_reason": "call_reason",
      "send_digits": "send_digits",
      "fallback_url": "fallback_url",
      "application_sid": "application_sid",
      "fallback_method": "fallback_method",
      "status_callback": "status_callback",
      "machine_detection": "machine_detection",
      "sip_auth_password": "sip_auth_password",
      "sip_auth_username": "sip_auth_username",
      "recording_channels": "recording_channels",
      "status_callback_event": "status_callback_event",
      "status_callback_method": "status_callback_method",
      "async_amd_status_callback": "async_amd_status_callback",
      "machine_detection_timeout": "machine_detection_timeout",
      "recording_status_callback": "recording_status_callback",
      "recording_status_callback_event": "recording_status_callback_event",
      "async_amd_status_callback_method": "async_amd_status_callback_method",
      "recording_status_callback_method": "recording_status_callback_method",
      "machine_detection_silence_timeout": "machine_detection_silence_timeout",
      "machine_detection_speech_threshold": "machine_detection_speech_threshold",
      "machine_detection_speech_end_threshold": "machine_detection_speech_end_threshold"
    },
    "remote_queue_response": {
    },
    "call_flow_logic": "CallFlowLogic::HelloWorld",
    "remotely_queued_at": null,
    "created_at": "2020-08-05T00:20:59.259Z",
    "updated_at": "2020-08-05T00:20:59.259Z",
    "duration": 0,
    "lock_version": 0,
    "account_id": 589
  }
]

Retrieve a Phone Call

Request

curl -g "https://scfm.somleng.org/api/phone_calls/217" -X GET \
    -H "Authorization: Bearer rFaAB7XxOxcFSuEUJScDxx_KsE71v1Wf0-ua1jMtdx8"

Endpoint

GET /api/phone_calls/:id

GET /api/phone_calls/217

Parameters

None known.

Response

Location: /api/phone_calls/217
200 OK
{
  "id": 217,
  "callout_participation_id": 257,
  "contact_id": 295,
  "create_batch_operation_id": null,
  "queue_batch_operation_id": null,
  "queue_remote_fetch_batch_operation_id": null,
  "status": "created",
  "msisdn": "+252662346053",
  "remote_call_id": null,
  "remote_status": null,
  "remote_direction": null,
  "remote_error_message": null,
  "metadata": {
  },
  "remote_response": {
  },
  "remote_request_params": {
    "to": "to",
    "url": "url",
    "byoc": "byoc",
    "from": "from",
    "trim": "trim",
    "twiml": "twiml",
    "method": "method",
    "record": "record",
    "timeout": "timeout",
    "async_amd": "async_amd",
    "caller_id": "caller_id",
    "call_reason": "call_reason",
    "send_digits": "send_digits",
    "fallback_url": "fallback_url",
    "application_sid": "application_sid",
    "fallback_method": "fallback_method",
    "status_callback": "status_callback",
    "machine_detection": "machine_detection",
    "sip_auth_password": "sip_auth_password",
    "sip_auth_username": "sip_auth_username",
    "recording_channels": "recording_channels",
    "status_callback_event": "status_callback_event",
    "status_callback_method": "status_callback_method",
    "async_amd_status_callback": "async_amd_status_callback",
    "machine_detection_timeout": "machine_detection_timeout",
    "recording_status_callback": "recording_status_callback",
    "recording_status_callback_event": "recording_status_callback_event",
    "async_amd_status_callback_method": "async_amd_status_callback_method",
    "recording_status_callback_method": "recording_status_callback_method",
    "machine_detection_silence_timeout": "machine_detection_silence_timeout",
    "machine_detection_speech_threshold": "machine_detection_speech_threshold",
    "machine_detection_speech_end_threshold": "machine_detection_speech_end_threshold"
  },
  "remote_queue_response": {
  },
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "remotely_queued_at": null,
  "created_at": "2020-08-05T00:20:59.882Z",
  "updated_at": "2020-08-05T00:20:59.882Z",
  "duration": 0,
  "lock_version": 0,
  "account_id": 600
}

Update a Phone Call

Request

curl "https://scfm.somleng.org/api/phone_calls/218" -d '{
  "msisdn": "252662346055",
  "remote_request_params": {
    "to": "to",
    "from": "from",
    "method": "method",
    "fallback_url": "fallback_url",
    "fallback_method": "fallback_method",
    "status_callback": "status_callback",
    "status_callback_event": "status_callback_event",
    "status_callback_method": "status_callback_method",
    "send_digits": "send_digits",
    "timeout": "timeout",
    "record": "record",
    "recording_channels": "recording_channels",
    "recording_status_callback": "recording_status_callback",
    "recording_status_callback_method": "recording_status_callback_method",
    "sip_auth_username": "sip_auth_username",
    "sip_auth_password": "sip_auth_password",
    "machine_detection": "machine_detection",
    "machine_detection_timeout": "machine_detection_timeout",
    "recording_status_callback_event": "recording_status_callback_event",
    "trim": "trim",
    "caller_id": "caller_id",
    "machine_detection_speech_threshold": "machine_detection_speech_threshold",
    "machine_detection_speech_end_threshold": "machine_detection_speech_end_threshold",
    "machine_detection_silence_timeout": "machine_detection_silence_timeout",
    "async_amd": "async_amd",
    "async_amd_status_callback": "async_amd_status_callback",
    "async_amd_status_callback_method": "async_amd_status_callback_method",
    "byoc": "byoc",
    "call_reason": "call_reason",
    "url": "url",
    "twiml": "twiml",
    "application_sid": "application_sid"
  },
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "metadata": {
    "bar": "foo"
  },
  "metadata_merge_mode": "replace"
}' -X PATCH \
    -H "Authorization: Bearer OASefwA9z90rj-bWfmSlWEDjrnmyBpqNRUPVIyAX93s"

Endpoint

PATCH /api/phone_calls/:id

PATCH /api/phone_calls/218

Parameters

{
  "msisdn": "252662346055",
  "remote_request_params": {
    "to": "to",
    "from": "from",
    "method": "method",
    "fallback_url": "fallback_url",
    "fallback_method": "fallback_method",
    "status_callback": "status_callback",
    "status_callback_event": "status_callback_event",
    "status_callback_method": "status_callback_method",
    "send_digits": "send_digits",
    "timeout": "timeout",
    "record": "record",
    "recording_channels": "recording_channels",
    "recording_status_callback": "recording_status_callback",
    "recording_status_callback_method": "recording_status_callback_method",
    "sip_auth_username": "sip_auth_username",
    "sip_auth_password": "sip_auth_password",
    "machine_detection": "machine_detection",
    "machine_detection_timeout": "machine_detection_timeout",
    "recording_status_callback_event": "recording_status_callback_event",
    "trim": "trim",
    "caller_id": "caller_id",
    "machine_detection_speech_threshold": "machine_detection_speech_threshold",
    "machine_detection_speech_end_threshold": "machine_detection_speech_end_threshold",
    "machine_detection_silence_timeout": "machine_detection_silence_timeout",
    "async_amd": "async_amd",
    "async_amd_status_callback": "async_amd_status_callback",
    "async_amd_status_callback_method": "async_amd_status_callback_method",
    "byoc": "byoc",
    "call_reason": "call_reason",
    "url": "url",
    "twiml": "twiml",
    "application_sid": "application_sid"
  },
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "metadata": {
    "bar": "foo"
  },
  "metadata_merge_mode": "replace"
}

None known.

Response

Location: /api/phone_calls/218
204 No Content

Remote Phone Call Events

Remote Phone Call Events are created by Somleng or Twilio Webhooks, when an event happens in a Phone Call. Setup your Somleng or Twilio Webhook endpoint to point to /api/remote_phone_call_events

List all Remote Phone Call Events

Request

curl -g "https://scfm.somleng.org/api/remote_phone_call_events?q[metadata][foo]=bar" -X GET \
    -H "Authorization: Bearer W0IpY7Y3huU64oMzrIj4tnW07FeBbJdKD0BZImidbz4"

Endpoint

GET /api/remote_phone_call_events

GET /api/remote_phone_call_events?q[metadata][foo]=bar

Parameters

q: {"metadata"=>{"foo"=>"bar"}}

None known.

Response

Per-Page: 25
Total: 1
200 OK
[
  {
    "id": 37,
    "phone_call_id": 224,
    "details": {
      "To": "345",
      "From": "252662346062",
      "CallSid": "3e08e053-0604-4d55-95b2-b2c2c049eba4",
      "Direction": "inbound",
      "AccountSid": "5cd0f121-6087-4356-8703-91c666fe5b4e",
      "ApiVersion": "2010-04-01",
      "CallStatus": "completed"
    },
    "metadata": {
      "foo": "bar"
    },
    "remote_call_id": "3e08e053-0604-4d55-95b2-b2c2c049eba4",
    "remote_direction": "inbound",
    "call_flow_logic": "CallFlowLogic::HelloWorld",
    "created_at": "2020-08-05T00:21:00.265Z",
    "updated_at": "2020-08-05T00:21:00.265Z",
    "call_duration": 0
  }
]

Retrieve a Remote Phone Call Event

Request

curl -g "https://scfm.somleng.org/api/remote_phone_call_events/48" -X GET \
    -H "Authorization: Bearer n-2MJbIA8xTspPfjWJI51VogHxpt6rArSZtobRpv-zE"

Endpoint

GET /api/remote_phone_call_events/:id

GET /api/remote_phone_call_events/48

Parameters

None known.

Response

Location: /api/remote_phone_call_events/48
200 OK
{
  "id": 48,
  "phone_call_id": 235,
  "details": {
    "To": "345",
    "From": "252662346084",
    "CallSid": "dbf2dfba-5611-4c56-8638-bf97fc2459ea",
    "Direction": "inbound",
    "AccountSid": "b80cc737-7219-4b8b-86c1-765551e976da",
    "ApiVersion": "2010-04-01",
    "CallStatus": "completed"
  },
  "metadata": {
  },
  "remote_call_id": "dbf2dfba-5611-4c56-8638-bf97fc2459ea",
  "remote_direction": "inbound",
  "call_flow_logic": "CallFlowLogic::HelloWorld",
  "created_at": "2020-08-05T00:21:00.668Z",
  "updated_at": "2020-08-05T00:21:00.668Z",
  "call_duration": 0
}

Update a Remote Phone Call Event

Request

curl "https://scfm.somleng.org/api/remote_phone_call_events/49" -d '{
  "metadata": {
    "foo": "bar"
  },
  "metadata_merge_mode": "replace"
}' -X PATCH \
    -H "Authorization: Bearer hxtl-m9hcAgsi8Z9Ttwe03nELa7pEazaYm7UGKu6eBU"

Endpoint

PATCH /api/remote_phone_call_events/:id

PATCH /api/remote_phone_call_events/49

Parameters

{
  "metadata": {
    "foo": "bar"
  },
  "metadata_merge_mode": "replace"
}

None known.

Response

Location: /api/remote_phone_call_events/49
204 No Content

Shared API Features

Filtering, Sorting and Pagination

All index requests can be filtered and sorted by using the q and sort parameters. Responses are paginated. The maxiumum number of items displayed for a single request is 25. This can be verified by the Per-Page response header. The actual number of items will appear in the Total header. If there are more than 25 items then you'll see a Link header with links to the first, last, next and previous pages. The links are formatted according to RFC-8288.

Request

curl -g "https://scfm.somleng.org/api/contacts?q[metadata][gender]=f&q[created_at_after]=2020-08-04&sort=-id%2Ccreated_at" -X GET \
    -H "Authorization: Bearer -3L05HI5OjLPhUA61vx47aC02kgL043DnErzs_IZtgc"

Endpoint

GET /api/contacts

GET /api/contacts?q[metadata][gender]=f&q[created_at_after]=2020-08-04&sort=-id%2Ccreated_at

Parameters

q: {"metadata"=>{"gender"=>"f"}, "created_at_after"=>"2020-08-04"}
sort: -id,created_at
Name Description
q A filter in which to filter resources. You can always filter by metadata, created_at and updated_at. Additional filters are available different resources
sort A comma separated list of sort columns. For example to sort by id in descending order, then by created_at in ascending order, specify sort: -id,created_at

Response

Per-Page: 25
Total: 26
200 OK
[
  {
    "id": 343,
    "msisdn": "+252662346113",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.994Z",
    "updated_at": "2020-08-05T00:21:00.994Z",
    "account_id": 620
  },
  {
    "id": 342,
    "msisdn": "+252662346112",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.991Z",
    "updated_at": "2020-08-05T00:21:00.991Z",
    "account_id": 620
  },
  {
    "id": 341,
    "msisdn": "+252662346111",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.986Z",
    "updated_at": "2020-08-05T00:21:00.986Z",
    "account_id": 620
  },
  {
    "id": 340,
    "msisdn": "+252662346110",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.982Z",
    "updated_at": "2020-08-05T00:21:00.982Z",
    "account_id": 620
  },
  {
    "id": 339,
    "msisdn": "+252662346109",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.977Z",
    "updated_at": "2020-08-05T00:21:00.977Z",
    "account_id": 620
  },
  {
    "id": 338,
    "msisdn": "+252662346108",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.973Z",
    "updated_at": "2020-08-05T00:21:00.973Z",
    "account_id": 620
  },
  {
    "id": 337,
    "msisdn": "+252662346107",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.970Z",
    "updated_at": "2020-08-05T00:21:00.970Z",
    "account_id": 620
  },
  {
    "id": 336,
    "msisdn": "+252662346106",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.966Z",
    "updated_at": "2020-08-05T00:21:00.966Z",
    "account_id": 620
  },
  {
    "id": 335,
    "msisdn": "+252662346105",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.962Z",
    "updated_at": "2020-08-05T00:21:00.962Z",
    "account_id": 620
  },
  {
    "id": 334,
    "msisdn": "+252662346104",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.958Z",
    "updated_at": "2020-08-05T00:21:00.958Z",
    "account_id": 620
  },
  {
    "id": 333,
    "msisdn": "+252662346103",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.954Z",
    "updated_at": "2020-08-05T00:21:00.954Z",
    "account_id": 620
  },
  {
    "id": 332,
    "msisdn": "+252662346102",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.950Z",
    "updated_at": "2020-08-05T00:21:00.950Z",
    "account_id": 620
  },
  {
    "id": 331,
    "msisdn": "+252662346101",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.947Z",
    "updated_at": "2020-08-05T00:21:00.947Z",
    "account_id": 620
  },
  {
    "id": 330,
    "msisdn": "+252662346100",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.944Z",
    "updated_at": "2020-08-05T00:21:00.944Z",
    "account_id": 620
  },
  {
    "id": 329,
    "msisdn": "+252662346099",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.942Z",
    "updated_at": "2020-08-05T00:21:00.942Z",
    "account_id": 620
  },
  {
    "id": 328,
    "msisdn": "+252662346098",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.939Z",
    "updated_at": "2020-08-05T00:21:00.939Z",
    "account_id": 620
  },
  {
    "id": 327,
    "msisdn": "+252662346097",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.936Z",
    "updated_at": "2020-08-05T00:21:00.936Z",
    "account_id": 620
  },
  {
    "id": 326,
    "msisdn": "+252662346096",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.933Z",
    "updated_at": "2020-08-05T00:21:00.933Z",
    "account_id": 620
  },
  {
    "id": 325,
    "msisdn": "+252662346095",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.928Z",
    "updated_at": "2020-08-05T00:21:00.928Z",
    "account_id": 620
  },
  {
    "id": 324,
    "msisdn": "+252662346094",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.922Z",
    "updated_at": "2020-08-05T00:21:00.922Z",
    "account_id": 620
  },
  {
    "id": 323,
    "msisdn": "+252662346093",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.919Z",
    "updated_at": "2020-08-05T00:21:00.919Z",
    "account_id": 620
  },
  {
    "id": 322,
    "msisdn": "+252662346092",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.912Z",
    "updated_at": "2020-08-05T00:21:00.912Z",
    "account_id": 620
  },
  {
    "id": 321,
    "msisdn": "+252662346091",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.909Z",
    "updated_at": "2020-08-05T00:21:00.909Z",
    "account_id": 620
  },
  {
    "id": 320,
    "msisdn": "+252662346090",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.904Z",
    "updated_at": "2020-08-05T00:21:00.904Z",
    "account_id": 620
  },
  {
    "id": 319,
    "msisdn": "+252662346089",
    "metadata": {
      "gender": "f"
    },
    "created_at": "2020-08-05T00:21:00.901Z",
    "updated_at": "2020-08-05T00:21:00.901Z",
    "account_id": 620
  }
]

Metadata

Metadata is useful for storing additional, structured information on an object. As an example, you could store the contact's name and gender on the Contact object.

Request

curl "https://scfm.somleng.org/api/contacts/346" -d '{
  "metadata": {
    "name": "Kate"
  },
  "metadata_merge_mode": "replace"
}' -X PATCH \
    -H "Authorization: Bearer pmXMnKiNSMlF5f3ZtrgtHgFnuuaq95rv1b7vrxvqZ7w"

Endpoint

PATCH /api/contacts/:id

PATCH /api/contacts/346

Parameters

{
  "metadata": {
    "name": "Kate"
  },
  "metadata_merge_mode": "replace"
}
Name Description
metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
metadata_merge_mode One of: merge (default), replace or deep_merge. merge merges the new metadata with the existing metadata. replace replaces the existing metadata with the new metadata. deep_merge deep merges the existing metadata with the new metadata.

Response

Location: /api/contacts/346
204 No Content

Users

Create a User

Request

curl "https://scfm.somleng.org/api/users" -d '{
  "email": "user32@example.com",
  "password": "secret123",
  "metadata": {
    "foo": "bar"
  }
}' -X POST \
    -H "Authorization: Bearer PQfVaiAnvzU_2zgFckUTV6CEm-fmTGUoZlf68CI28_s"

Endpoint

POST /api/users

POST /api/users

Parameters

{
  "email": "user32@example.com",
  "password": "secret123",
  "metadata": {
    "foo": "bar"
  }
}
Name Description
email required The email address of the user
password required The initial password of the user. The user can change their password when they log in.

Response

Location: /api/users/25
201 Created
{
  "id": 25,
  "account_id": 627,
  "metadata": {
    "foo": "bar"
  },
  "email": "user32@example.com",
  "created_at": "2020-08-05T00:21:01.195Z",
  "updated_at": "2020-08-05T00:21:01.195Z",
  "locale": "en"
}

Create a User Event

Request

curl "https://scfm.somleng.org/api/users/30/user_events" -d '{
  "event": "invite"
}' -X POST \
    -H "Authorization: Bearer MhUz4qjANUsPJkCNsGBN1qSnzi5i3x5GUp0hJlNbVF8"

Endpoint

POST /api/users/:user_id/user_events

POST /api/users/30/user_events

Parameters

{
  "event": "invite"
}
Name Description
event required Only invite is supported at this time

Response

Location: /api/users/30
201 Created
{
  "account_id": 633,
  "id": 30,
  "metadata": {
  },
  "email": "user37@example.com",
  "created_at": "2020-08-05T00:21:01.325Z",
  "updated_at": "2020-08-05T00:21:01.340Z",
  "locale": "en"
}

Delete a User

Request

curl "https://scfm.somleng.org/api/users/29" -d '' -X DELETE \
    -H "Authorization: Bearer KsqvChnnfTMMfMB06K9u0bCJd5E8zUPZZFuIkWgimRc"

Endpoint

DELETE /api/users/:id

DELETE /api/users/29

Parameters

None known.

Response

Location: /api/users
204 No Content

List all Users

Request

curl -g "https://scfm.somleng.org/api/users?q[metadata][foo]=bar" -X GET \
    -H "Authorization: Bearer b3qLFluRJsVRelBiOuKv6CXGGdtSrNmQvdtHBTTUAVw"

Endpoint

GET /api/users

GET /api/users?q[metadata][foo]=bar

Parameters

q: {"metadata"=>{"foo"=>"bar"}}

None known.

Response

Per-Page: 25
Total: 1
200 OK
[
  {
    "id": 20,
    "account_id": 623,
    "metadata": {
      "foo": "bar"
    },
    "email": "user27@example.com",
    "created_at": "2020-08-05T00:21:01.101Z",
    "updated_at": "2020-08-05T00:21:01.101Z",
    "locale": "en"
  }
]

Retrieve a User

Request

curl -g "https://scfm.somleng.org/api/users/27" -X GET \
    -H "Authorization: Bearer dxwMpYDnU6KrYGetfQhsYiAzozgl1ZSd0WtQTV9erE4"

Endpoint

GET /api/users/:id

GET /api/users/27

Parameters

None known.

Response

Location: /api/users/27
200 OK
{
  "id": 27,
  "account_id": 630,
  "metadata": {
  },
  "email": "user34@example.com",
  "created_at": "2020-08-05T00:21:01.239Z",
  "updated_at": "2020-08-05T00:21:01.239Z",
  "locale": "en"
}

Update a User

Request

curl "https://scfm.somleng.org/api/users/28" -d '{
  "metadata": {
    "bar": "foo"
  },
  "metadata_merge_mode": "replace"
}' -X PATCH \
    -H "Authorization: Bearer t6kzXkWm-PP9hUSUo_MJIgOoDOdcaMIpBgPFUI5bPm4"

Endpoint

PATCH /api/users/:id

PATCH /api/users/28

Parameters

{
  "metadata": {
    "bar": "foo"
  },
  "metadata_merge_mode": "replace"
}

None known.

Response

Location: /api/users/28
204 No Content