Field Encoding option helps to encode symbols or attached templates in HTTP, XML and SOAP requests in order to convert them into a format supported by Buyer API.
HTTP Encoding
In HTTP request, Encoding option is applicable to text fields with spaces and some symbols: ‘(’, ‘)’, ‘,’, etc.
Most often, TCPA Text, User Agent and Coverage type fields are used with URL Encoding in HTTP requests. However, any other text fields with spaces required by Buyer Specification or hardcoded text should be encoded as well.
HTTP Encoding Flow
To encode a field in HTTP request, perform the following:
1. Map the field according to Buyer Specification (userAgent in our HTTP example):
2. On the Mapping Panel, select URL in the Encoding Type dropdown menu:
3. Open the PX specification for Auto Vertical and find the following UserAgent message:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36
Copy and paste this text to Custom Value For Non Collected Leads field:
Custom Value For Non Collected Leads field is used for open fields (fields that do not have the list of accepted values (User Agent, TCPA Text, etc.) and when the field is required by Buyer Specification, but there is no such field sent in the Lead. In this case, default value specified is sent in the request.
4. Click Save at the bottom of the Step 2 - Map API Inputs.
Test your mappings on Step 4 to check if encoding works properly:
How to Determine if URL Encoding is Necessary in HTTP Request?
If encoding requirements are not mentioned in Buyer Specification, check whether it contains a sample HTTP request. If spaces in text are replaced by ‘%’ or ‘+’ symbols, fields that contain text with spaces must be encoded.
Despite the fact that most Buyers do not require encoding, for some Buyers it is critical. It is recommended to configure URL Encoding for all HTTP requests, regardless of Buyer Specification requirements.
XML and SOAP Encoding
In XML and SOAP requests, Encoding option is used for attached templates and for the text including the following symbols: the less than sign (<), the greater than sign (>), the ampersand (&), the single quote ('), and the double quote (").
Usually XML encoding is configured according to direct instructions in Buyer Specification or by request. However, in most cases Insurance Company field is used with XML Encoding because some insurance company names contain ‘&’ symbol.
XML and SOAP Encoding Flow
To encode a field in XML or SOAP request, perform the following:
1. Map the field according to Buyer Specification (insuranceCompany in our case):
2. On the Mapping Panel, select XML in the Encoding Type dropdown menu:
Test your mappings on Step 4 to check if encoding works properly:
How to Determine if XML Encoding is Necessary?
If a Buyer Specification contains sample XML request, check whether ‘&’ symbols are replaced by ‘&’. If yes, fields containing ‘&’ symbols must be encoded.
Attached XML Template Encoding
XML Encoding is also used in Attached XML Templates if that is required by Buyer Specification.
To encode an attached XML template, perform the following:
1. Create an attached template according to instructions:
2. On the Mapping Panel, select XML in Encoding Type dropdown menu:
When XML request attached to SOAP or HTTP requests is encoded, this encoding applies to all fields inside the attached template.
0 comments
Please sign in to leave a comment.