How to Configure an HTTP POST Carrier Transcript for Video:
Welcome to the video tutorial on how to configure HTTPPOST carriers in PageGate. In this tutorial, we'll be going over how to communicate with a web API that requires information to be submitted by an HTTP POST request.
Before we begin, to have PageGate communicate with a web API using the HTTP POST method, you'll need two bits of information.
First, you'll need the URL to submit the messages to and this should be provided by the web API host.
Second, you'll need the format and parameters to submit to the URL. Some hosts will accept messages submitted in XML or JSON format while others may want you to submit a web form. Again, this information should be provided by the web API host.
Once you have the URL, parameter names, values and data format, here's how to configure PageGate.
As an example, let's say that this is our API URL:
Let's also say that the host needs Authorization, Accept, and Content-Type variables declared and that it can accept messages in XML or JSON.
That would mean that a constructed HTTP POST statement to that API URL would be something like this:
POST /api.yourmessaghost.com/sms/1/text/single HTTP/1.1
To configure PageGate to send HTTP POST requests, you'll first want to open the PageGate Admin.
Next, right click on the Carriers section and select 'Add'.
Give the carrier a name. This can be anything you like but I do recommend giving it a straightforward name as that will make administration easier in the long run.
Next, select the HTTPPOST protocol.
Once you do, it will ask for the host, port and max characters. You'll want to set the Host to match the API URL.
Set the Port to match the port that the host requires (http:// requests typically use port 80 and https:// requests typically use port 443)
Set the max characters to a value that reflects the type of message you're sending. For example, if you're sending SMS, set this to 160 as an SMS can only contain 160 characters. Set it to 240 for pagers and 6000 for email or any other form of message.
Click Apply to add the carrier in to the list, and then click on the + next to its name and go to the Template sub-section.
Here in the template, we're going to tell PageGate what parameters to pass to the URL and what format you're going to submit (XML, JSON or web form).
To declare a parameter name and value, you'll use this format:
Note: The vertical bars seen above are called "pipe" symbols and can be found above the backslash (\) on most keyboards.
To use our earlier example, let's say there are three parameters to configure: Authorization, Accept and Content Type.
Authorization is going to declare your credentials and the host will declare the format you'll need to provide:
Next, we're going to declare which format we're submitting. This statement would be for XML:
and this would be for JSON:
Next, we're going to declare the content type of the format. This statement would be for XML:
and this would be for JSON:
Last, we want to configure either the XML or JSON formatted message statement, as required by the web API host.
So, the complete Text section to submit XML data should look like this:
and the complete Text section to submit JSON data should look like this:
When finished, click Apply.
This concludes the tutorial on how to configure HTTP POST carriers in PageGate to communicate with a web API.