Skip to content

Commit 34f2deb

Browse files
Update Text Request Connector (#3618)
* Make some Text Request parameters optional * Add triggers to connector * Fix summary of post webhook
1 parent efac621 commit 34f2deb

File tree

2 files changed

+212
-7
lines changed

2 files changed

+212
-7
lines changed

certified-connectors/Text Request/apiDefinition.swagger.json

+211-7
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515
"schemes": [
1616
"https"
1717
],
18-
"consumes": ["application/json"],
19-
"produces": ["application/json"],
18+
"consumes": [
19+
"application/json"
20+
],
21+
"produces": [
22+
"application/json"
23+
],
2024
"paths": {
2125
"/dashboards/{dashboard_id}/contacts/{phone_number}/messages": {
2226
"get": {
@@ -263,7 +267,7 @@
263267
"/dashboards/{dashboard_id}/contacts/{phone_number}/conversations/archive": {
264268
"put": {
265269
"summary": "Archive a Conversation",
266-
"description": "Archiving a conversation removes it from the results of all conversation retrieval endpoints. A conversation will be automatically unarchived if the customer sends a text to your Text Request number, or if you send the customer a text from your Text Request number. Archiving conversations is a good way to remove clutter from customers you dont plan on talking to in the future. Note that if a customer texts in \"STOP\" to prevent you from sending them any further SMS messages, the conversation is automatically archived.",
270+
"description": "Archiving a conversation removes it from the results of all conversation retrieval endpoints. A conversation will be automatically unarchived if the customer sends a text to your Text Request number, or if you send the customer a text from your Text Request number. Archiving conversations is a good way to remove clutter from customers you don't plan on talking to in the future. Note that if a customer texts in \"STOP\" to prevent you from sending them any further SMS messages, the conversation is automatically archived.",
267271
"operationId": "ArchiveConversation",
268272
"parameters": [
269273
{
@@ -1672,12 +1676,15 @@
16721676
}
16731677
],
16741678
"responses": {
1675-
"204": {
1676-
"description": "The return payload when the request succeeds, but found no content to return.",
1679+
"200": {
1680+
"description": "The return payload when the request succeeds without any errors.",
16771681
"schema": {
16781682
"type": "string"
16791683
}
16801684
},
1685+
"204": {
1686+
"description": "The return payload when the request succeeds, but found no content to return."
1687+
},
16811688
"400": {
16821689
"description": "The return payload when the request has bad, missing, or invalid data."
16831690
},
@@ -2782,12 +2789,15 @@
27822789
}
27832790
],
27842791
"responses": {
2785-
"204": {
2786-
"description": "The return payload when the request succeeds, but found no content to return.",
2792+
"200": {
2793+
"description": "The return payload when the request succeeds without any errors.",
27872794
"schema": {
27882795
"type": "string"
27892796
}
27902797
},
2798+
"204": {
2799+
"description": "The return payload when the request succeeds, but found no content to return."
2800+
},
27912801
"400": {
27922802
"description": "The return payload when the request has bad, missing, or invalid data."
27932803
},
@@ -3143,6 +3153,200 @@
31433153
}
31443154
}
31453155
}
3156+
},
3157+
"/dashboards/{dashboard_id}/hooks": {
3158+
"x-ms-notification-content": {
3159+
"schema": {
3160+
"type": "object",
3161+
"properties": {
3162+
"messageUniqueIdentifier": {
3163+
"type": "string",
3164+
"description": "messageUniqueIdentifier"
3165+
},
3166+
"account": {
3167+
"type": "object",
3168+
"properties": {
3169+
"id": {
3170+
"type": "integer",
3171+
"format": "int32",
3172+
"description": "id"
3173+
},
3174+
"externalAccountId": {
3175+
"type": "string",
3176+
"description": "externalAccountId"
3177+
}
3178+
},
3179+
"description": "account"
3180+
},
3181+
"yourPhoneNumber": {
3182+
"type": "object",
3183+
"properties": {
3184+
"id": {
3185+
"type": "integer",
3186+
"format": "int32",
3187+
"description": "id"
3188+
},
3189+
"externalPhoneId": {
3190+
"type": "string",
3191+
"description": "externalPhoneId"
3192+
},
3193+
"description": {
3194+
"type": "string",
3195+
"description": "description"
3196+
},
3197+
"phoneNumber": {
3198+
"type": "string",
3199+
"description": "phoneNumber"
3200+
}
3201+
},
3202+
"description": "yourPhoneNumber"
3203+
},
3204+
"conversation": {
3205+
"type": "object",
3206+
"properties": {
3207+
"id": {
3208+
"type": "integer",
3209+
"format": "int32",
3210+
"description": "id"
3211+
},
3212+
"date": {
3213+
"type": "string",
3214+
"description": "date"
3215+
},
3216+
"consumerPhoneNumber": {
3217+
"type": "string",
3218+
"description": "consumerPhoneNumber"
3219+
},
3220+
"messageDirection": {
3221+
"type": "string",
3222+
"description": "messageDirection"
3223+
},
3224+
"message": {
3225+
"type": "string",
3226+
"description": "message"
3227+
},
3228+
"numSegments": {
3229+
"type": "integer",
3230+
"format": "int32",
3231+
"description": "numSegments"
3232+
},
3233+
"status": {
3234+
"type": "string",
3235+
"description": "status"
3236+
},
3237+
"claimedBy": {
3238+
"type": "string",
3239+
"description": "claimedBy"
3240+
},
3241+
"consumerFriendlyName": {
3242+
"type": "string",
3243+
"description": "consumerFriendlyName"
3244+
},
3245+
"mmsAttachments": {
3246+
"type": "array",
3247+
"items": {},
3248+
"description": "mmsAttachments"
3249+
}
3250+
},
3251+
"description": "conversation"
3252+
}
3253+
}
3254+
},
3255+
"description": "Webhook info"
3256+
},
3257+
"post": {
3258+
"x-ms-trigger": "single",
3259+
"summary": "Triggers when a text is sent or received",
3260+
"description": "Triggers when a text is sent or received",
3261+
"operationId": "TextingWebhook",
3262+
"parameters": [
3263+
{
3264+
"name": "dashboard_id",
3265+
"description": "Id of dashboard to add trigger to",
3266+
"in": "path",
3267+
"required": true,
3268+
"type": "string",
3269+
"x-ms-summary": "Dashboard the trigger will listen to events from",
3270+
"x-ms-url-encoding": "single",
3271+
"x-ms-dynamic-values": {
3272+
"operationId": "GetDashboards",
3273+
"value-path": "id",
3274+
"value-collection": "items",
3275+
"value-title": "name",
3276+
"parameters": {
3277+
"page": 0,
3278+
"page_size": 50
3279+
}
3280+
},
3281+
"x-ms-visibility": "important"
3282+
},
3283+
{
3284+
"name": "body",
3285+
"in": "body",
3286+
"required": true,
3287+
"schema": {
3288+
"type": "object",
3289+
"properties": {
3290+
"target_url": {
3291+
"type": "string",
3292+
"description": "Url the webhook will redirect to",
3293+
"x-ms-notification-url": true,
3294+
"title": "target_url",
3295+
"x-ms-visibility": "internal"
3296+
},
3297+
"event": {
3298+
"type": "string",
3299+
"description": "event",
3300+
"title": "",
3301+
"x-ms-visibility": "important",
3302+
"enum": [
3303+
"msg_received",
3304+
"msg_sent"
3305+
]
3306+
},
3307+
"httpVerb": {
3308+
"type": "string",
3309+
"description": "httpVerb",
3310+
"title": "",
3311+
"default": "POST",
3312+
"x-ms-visibility": "internal"
3313+
}
3314+
},
3315+
"required": [
3316+
"target_url",
3317+
"httpVerb",
3318+
"event"
3319+
]
3320+
}
3321+
}
3322+
],
3323+
"responses": {
3324+
"200": {
3325+
"description": "The return payload when the request succeeds without any errors.",
3326+
"schema": {
3327+
"type": "object",
3328+
"properties": {
3329+
"id": {
3330+
"type": "integer",
3331+
"format": "int32",
3332+
"description": "The numerical id of the dashboard."
3333+
},
3334+
"target_url": {
3335+
"type": "string",
3336+
"description": "The url the webhook will post to"
3337+
},
3338+
"event": {
3339+
"type": "string",
3340+
"description": "The webhook's associated trigger event"
3341+
}
3342+
}
3343+
}
3344+
},
3345+
"400": {
3346+
"description": "The return payload when the request has bad, missing, or invalid data."
3347+
}
3348+
}
3349+
}
31463350
}
31473351
},
31483352
"definitions": {},

certified-connectors/Text Request/readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Text Request supports a wide variety of operations (no triggers) for handling yo
3232
* Get Conversations
3333
* Get Dashboards
3434
* Create A New Dashboard
35+
* A Trigger for when messages are sent or received
3536

3637
## Obtaining Credentials
3738
Text Request plans with API access will be given an automatically generated API Key, found in the integrations section of the web app. Just copy this API Key into the connector's Auth box when creating this connection.

0 commit comments

Comments
 (0)