Link Search Menu Expand Document

Updated Thu Sep 23rd 2021, 14:49 UTC

Create

POST /:account/integrations

Note: This endpoint is still under active development, and may change without warning.

TextUs supports integrating with many partners and third-party services. Each provider has its own set of config parameters.

The most common provider is ‘webhook’, please see the associated documentation for details.

Examples

Create an Integration

Request

POST /my_account/integrations

Body

{
  "@type": "Integration",
  "@context": "/contexts/Integration.jsonld",
  "active": true,
  "provider": "webhook",
  "config": {
    "baseUrl": "https://www.example.com/callback"
  },
  "settings": {
    "actions": {
      "message.received": true,
      "message.delivered": true,
      "message.failed": true,
      "message.unknown": false,
      "phone_call.completed": false,
      "contact.opted_out": true,
      "contact.opted_in": true
    }
  }
}
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
    -H Authorization:"Bearer {token}" \
    -X POST /my_account/integrations
     -d '{json: "body"}' 

Response

Status

201

Response Type

Integration

Example
{
  "@type": "Integration",
  "@context": "/contexts/Integration.jsonld",
  "id": "/integrations/0yX2VrJ",
  "active": true,
  "provider": "webhook",
  "config": {
    "baseUrl": "https://foo.bar.com/zest",
    "webhookSecret": "textus-abcdefgh12345678"
  },
  "settings": {
    "actions": {
      "message.received": true,
      "message.delivered": true,
      "message.failed": true,
      "message.unknown": false,
      "phone_call.completed": false,
      "contact.opted_out": true,
      "contact.opted_in": true
    }
  }
}

© 2021 TextUs