NOTE: When referencing any non-printable character, such as a line feed, carriage return, horizontal tab or similar, you must use the ASCII code for that character and it must be prefixed by a backslash (\).
Templates for HTTP POST carriers tell PageGate how to interact and how to structure data passed to a web form, Web API or REST API.
It's important to gather as much information as you can about what API or webform you're interacting with and their documentation will typically provide required variables and how they need to be implemented.
Conceptually, the 'Settings' section of a POST carrier template tells PageGate if the API requires any special interaction and the 'Text' section determines what variables to declare and how to structure the message body.
These values can be used in the 'Settings' section of an HTTP POST carrier:
Variable
|
Possible Values
|
Example Statement
|
Description
|
ResponseRecipient
|
Recipient
Group
|
ResponseRecipient = A recipient or group's name as it exists in the PG Admin
|
When the HTTP GET or POST transaction completes, the specified recipient or group will receive any responses from the receiving API/web host. For more information, please see the Two Way Messaging section of the documentation.
|
HttpPostType
|
HeadBody
|
HttpPostType = HeadBody
|
This variable configures an HTTP POST carrier to provide header information followed by structured data, usually JSON or XML, in the body.
|
HttpSuccessResponse
|
Text
|
See Description
|
This variable tells PageGate to scan any responses back from a GET or POST request for the required keywords or keyphrases. If those keywords or keyphrases are found, the message is treated as successfully delivered.
This variable is both case and punctuation sensitive and PageGate will look for an exact match to what you enter.
Multiple search terms may be used and you'll need to separate each item with a pipe.
For example, this would only scan for the word success:
HttpSuccessResponse = success
This would scan for the word success in the <Reply> tag:
HttpSuccessResponse = <Reply>success</Reply>
This would scan for the word success in the <Reply> tag OR the word hijinks:
HttpSuccessResponse = <Reply>success</Reply>|hijinks
This would scan for the word success OR the word hijinks OR the word actualization:
HttpSuccessResponse = success|hijinks|actualization
If this variable is included, any response to a GET/POST request that doesn't include the search term(s) will be treated as a failure.
|
HttpErrorResponse
|
Text
|
See Description
|
This variable tells PageGate to scan any responses back from a GET or POST request for the specified keywords or keyphrases. If those keywords or keyphrases are found, the message is treated as failed or rejected.
This variable is both case and punctuation sensitive and PageGate will look for an exact match to what you enter.
Multiple search terms may be used and you'll need to separate each item with a pipe.
For example, this would only scan for the word failed:
HttpErrorResponse = failed
This would scan for the word success in the <Reply> tag:
HttpErrorResponse = <Reply>failed</Reply>
This would scan for the word failed in the <Reply> tag OR the word reject:
HttpErrorResponse = <Reply>failed</Reply>|reject
This would scan for the word failed OR the word reject OR the phrase object not found:
HttpErrorResponse = failed|reject|object not found
If this variable is included, any response to a GET/POST request that includes the search term(s) will be treated as a failure.
|
This is how to use the 'Text' section of an HTTP POST carrier:
Each value you specify will need to correspond to a variable that the receiving API will recognize. For example, let's say we wanted to send a message using Twilio's API. We know they're looking that looked for to, from and body as variables. We would need to format the text template as follows:
|to|%RecipientId%|
|from|%Sender%|
|body|%Message%|
NOTE: | is a pipe character and is found on most keyboards above the backslash character, \.
Some APIs, like MessageBird, require an authentication variable in the body of the POST and those are declared like any other variable.
Example:
|Authorization|AccessKey PasteYourAccessKeyHere|
|recipients|%RecipientId%|
|originator|%Sender%|
|body|%Message%|
|