Keywords
Keywords are text fields that can be added to a campaign that when responded to in an inbound message can trigger an action such as firing a webhook if one is attached to it.
Create Keyword
Keywords can be attached to contact groups and assigned to call a webhook if one is received in an inbound message.
Either of these options can be enabled by setting their respective boolean
flags to true and providing one or more for their respective uuid arrays.
Request
curl --location 'https://passona.co.uk/api/2.0/keywords/' \
--header 'Authorization: Bearer B1gooyw1FlLcITdn2nd4vfem4b4YYogJUGjVTnrrSTOt2T5hCFnS2xpANsYd' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"keyword": "OPTOUT",
"message": "Keyword Message info",
"help": "Tooltip help text",
"add_contact_to_group": true,
"call_webhook": true,
"contact_groups_uuid": ["16f7a9aa-f4e0-11e9-9aed-0242ac120006"],
"webhooks_uuid": ["491460ee-fb0d-11e9-a46c-0a586460022b"]
}'
Response
{
"data": {
"uuid": "f3357bfe-fb20-11e9-93ef-0242ac120008",
"keyword": "OPTOUT",
"message": "Keyword Message info",
"status": "1",
"help": "Tooltip help text",
"add_contact_to_group": true,
"contact_groups_uuid": [
"16f7a9aa-f4e0-11e9-9aed-0242ac120006"
],
"call_webhook": false,
"webhooks_uuid": [
"491460ee-fb0d-11e9-a46c-0a586460022b"
],
"links": [
{
"rel": "self",
"uri": "http://passona.test/api/2.0/keywords/f3357bfe-fb20-11e9-93ef-0242ac120008"
}
]
}
}
Edit Keyword
Keywords can be updated by changing any of its fields.
Request
curl --location --request PUT 'https://passona.co.uk/api/2.0/keywords/f3357bfe-fb20-11e9-93ef-0242ac120008' \
--header 'Authorization: Bearer B1gooyw1FlLcITdn2nd4vfem4b4YYogJUGjVTnrrSTOt2T5hCFnS2xpANsYd' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"keyword": "OPTOUT-UPDATE",
"message": "Keyword Message info",
"help": "Tooltip help text",
"add_contact_to_group": true,
"call_webhook": true,
"contact_groups_uuid": ["16f7a9aa-f4e0-11e9-9aed-0242ac120006"],
"webhooks_uuid": ["491460ee-fb0d-11e9-a46c-0a586460022b"]
}'
Response
{
"data": {
"uuid": "f3357bfe-fb20-11e9-93ef-0242ac120008",
"keyword": "OPTOUT-UPDATE",
"message": "Keyword Message info",
"status": "1",
"help": "Tooltip help text",
"add_contact_to_group": true,
"contact_groups_uuid": [
"16f7a9aa-f4e0-11e9-9aed-0242ac120006"
],
"call_webhook": false,
"webhooks_uuid": [
"491460ee-fb0d-11e9-a46c-0a586460022b"
],
"links": [
{
"rel": "self",
"uri": "http://passona.test/api/2.0/keywords/f3357bfe-fb20-11e9-93ef-0242ac120008"
}
]
}
}
Show Keyword
You can retrieve an individual keyword by passing the uuid
into the url.
Request
curl --location 'https://passona.co.uk/api/2.0/keywords/f3357bfe-fb20-11e9-93ef-0242ac120008' \
--header 'Authorization: Bearer B1gooyw1FlLcITdn2nd4vfem4b4YYogJUGjVTnrrSTOt2T5hCFnS2xpANsYd' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'
Response
{
"data": {
"uuid": "f3357bfe-fb20-11e9-93ef-0242ac120008",
"keyword": "OPTOUT-UPDATE",
"message": "Keyword Message info",
"status": "1",
"help": "Tooltip help text",
"add_contact_to_group": true,
"contact_groups_uuid": [
"16f7a9aa-f4e0-11e9-9aed-0242ac120006"
],
"call_webhook": true,
"webhooks_uuid": [
"491460ee-fb0d-11e9-a46c-0a586460022b"
],
"links": [
{
"rel": "self",
"uri": "http://passona.test/api/2.0/keywords/f3357bfe-fb20-11e9-93ef-0242ac120008"
}
]
}
}
Retrieve All Keywords
Returns a paginated list of keywords for your current team.
Default pagination length is 15 per page.
This can be changed if needed by adding a query parameter of /?per_page=
and the number you wish to paginate by.
Request
curl --location 'https://passona.co.uk/api/2.0/keywords/' \
--header 'Authorization: Bearer B1gooyw1FlLcITdn2nd4vfem4b4YYogJUGjVTnrrSTOt2T5hCFnS2xpANsYd' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'
Response
{
"data": [
{
"uuid": "f3357bfe-fb20-11e9-93ef-0242ac120008",
"keyword": "OPTOUT-UPDATE",
"message": "Keyword Message info",
"status": "1",
"help": "Tooltip help text",
"add_contact_to_group": true,
"contact_groups_uuid": [
"16f7a9aa-f4e0-11e9-9aed-0242ac120006"
],
"call_webhook": true,
"webhooks_uuid": [
"491460ee-fb0d-11e9-a46c-0a586460022b"
],
"links": [
{
"rel": "self",
"uri": "http://passona.test/api/2.0/keywords/f3357bfe-fb20-11e9-93ef-0242ac120008"
}
]
}
],
"links": {
"first": "http://passona.test/api/2.0/keywords?page=1",
"last": "http://passona.test/api/2.0/keywords?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "http://passona.test/api/2.0/keywords",
"per_page": 15,
"to": 1,
"total": 1
}
}
Delete Keyword
Delete a specific keyword by passing its uuid
into the url.
There is no response body for this request. The HTTP status will be 204 - No Content
when successful.
Request
curl --location --request DELETE 'https://passona.co.uk/api/2.0/keywords/f3357bfe-fb20-11e9-93ef-0242ac120008' \
--header 'Authorization: Bearer B1gooyw1FlLcITdn2nd4vfem4b4YYogJUGjVTnrrSTOt2T5hCFnS2xpANsYd' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'