Skip to content

Keywords

You can use this API to programmatically add new keywords to your account, for use with value added services (VAS).

Access to this API requires a separate agreement with GatewayAPI, intended for resellers and/or accounts with large needs for two-way messaging.

List Keywords

GET /api/vas

Get a list of keywords

Request Headers:

1
2
3
4
5
GET /api/vas HTTP/1.1
User-Agent: curl/7.37.1
Host: gatewayapi.com
Accept: */*
Authorization: Basic TzFsa3FtTGhRdHFRMXpHNHp

Example response:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 148

[
    {
        "shortcode": 451204,
        "keyword": "charlie",
        "pushsetting_reference": "foo"
    }
]

Add Keyword

POST /api/vas/check

Check if a keyword is available

Request JSON Object:

  • keyword (string) - Keyword to search for
  • shortcode (integer) - ie. 451204

Response JSON Object:

  • system (string) - System using the keyword (gatewayapi)
  • available (boolean) - Is the keyword available

Request Headers:

Status Codes:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
POST /api/vas/check HTTP/1.1
Host: gatewayapi.com
Accept: */*
Authorization: Basic TzFsa3FtTGhRdHFRMXpHNHp
Content-Type: application/json

{
    "shortcode": 451204,
    "keyword": "foobar"
}

Example response:

1
2
3
4
5
6
7
HTTP/1.1 200 OK
Content-Type: application/json

{
    "available": false,
    "system": "gatewayapi"
}

POST /api/vas

Add a new keyword

Please note that the price for the keyword will be deducted from your GatewayAPI Credit immediately upon adding the keyword.

When adding a new keyword you are charged the full price, regardless how many days are left in the month until the next invoice period.

If you want to assign the new keyword to a webhook right away, set the optional field pushsetting_reference to the “unique label” of the webhook.

Request JSON Object:

  • keyword (string) - Keyword to add
  • shortcode (integer) - i.e. 451204
  • pushsetting_reference (string) - Optional webhook to assign to

Request Headers:

Status Codes:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
POST /api/vas HTTP/1.1
Host: gatewayapi.com
Accept: */*
Authorization: Basic TzFsa3FtTGhRdHFRMXpHNHp
Content-Type: application/json

{
    "shortcode": 451204,
    "keyword": "foobar"
}

Example response:

1
2
3
4
5
6
7
8
9
HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "account_id": 1,
    "keyword": "foobar",
    "pushsetting_reference": null,
    "shortcode": 451204
}

DELETE /api/vas/{shortcode:int}/(keyword)

Cancel the keyword.

Note that your keyword will remain active on your account until the end of the subscription period.

Query Parameters:

  • shortcode - ie. 451204
  • keyword - The keyword to delete

Request Headers:

Status Codes:

1
2
3
4
DELETE /api/vas/451204/foobar HTTP/1.1
Host: gatewayapi.com
Accept: */*
Authorization: Basic TzFsa3FtTGhRdHFRMXpHNHp

Example response:

1
2
HTTP/1.1 204 OK
Content-Length: 0