Direct Post – Exclusive

API 2.0 Specifications for Primary Care Services

Introduction

This document describes how to post exclusive primary care services leads to PX using direct post. We accept POST requests in XML and JSON.

Posting URL

Before leads can be posted into PX’s live environment, tests need to be performed to ensure success. For testing purposes, PX will set the publisher campaign to a test mode during the integration. All the tests and responses on these tests can be found in the Test leads report.

Post URL: https://leadapi.px.com/api/lead/directpost

Forcing a success: When 90170 zip code is used in the staging environment, the API will respond with success if the API is configured correctly.

Once a lead has been successfully posted and proper posting is confirmed by PX, leads can be posted to the live environment. To post into the live environment, PX will set the publisher campaign to the production mode after approving the successful test.

 

Header Fields Table

Key Required Value
Content-Type Yes Application/json for JSON requests
Application/xml for XML requests
Accept No Application/json for JSON response
Application/xml for XML response

Examples

Fields Table

Parameter Required Accepted Values
Description (data type)
ApiToken Yes Provided by PX GUID format
Vertical Yes PrimaryCareServices String
SubId Yes Format provided at start String
Sub2Id No   String
Sub3Id No   String
Sub4Id No   String
Sub5Id No   String
UserAgent Yes   String
OriginalURL Yes URL where the lead is from String
Source Yes Discuss with Acc. Manager String
JornayaLeadId Yes Jornaya LeadId (GUID format) See link on how to implement on form
Trustedform
Yes TrustedForm Cert. URL. https://cert.trustedform.com/ ID See link on how to implement on form
SessionLength Yes Amount of time spent by the user to fill out the form in seconds String
TcpaText Yes Consent language String
SellResponseURL No Postback URL See explanation on this parameter
OriginalCreationDate For aged data only Exact date the aged lead originally has been created: yyyy-mm-dd hh:mm:ssZ String
FirstTimeBuyer
Yes Yes/No String
SiteLicenseNumber
No The SMID related to the CMS approval String
FirstName Yes String
LastName Yes String
Address Yes String
City Yes String
State Yes See accepted values list String
ZipCode Yes 5 digit zip code String
EmailAddress Yes Valid email address String
PhoneNumber Yes Valid 10 digit phone number without formatting 8887777777 Integer
DayPhoneNumber Yes Valid 10 digit phone number without formatting 8887777777 Integer
IpAddress Yes Example: 38.88.150.2 Integer
BirthDate Yes YYYY-MM-DD String
Gender Yes Male / Female String
RelationshipToApplicant Yes See accepted values String
HouseHoldIncome Yes Below $30,000 / $30,000 – $44,999 / $45,000 – $59,999 /
$60,000 – $74,999 /
Above $75,000
String
HouseHoldSize Yes  Number String
Product Yes (MO) Medicare Original /
(MA) Medicare Advantage /
(MD) Medicare Part D /
(MS) Medicare Supplement
String
MaritalStatus No Divorced / Married / Separated / Single / Widowed String
DeniedInsurance No Yes / No String
USResidence No True / False Boolean
Height_FT No Integer
Height_Inch No Integer
Weight No Weight in pounds Integer
Student No True / False Boolean
Occupation No See accepted values String
Education No See accepted values String
HasMedicareCard No Yes / No String
EligibleDisability No Yes / No String
CurrentPolicy
No See accepted values String
LocationPreference Yes In-Home / Clinic / No preference String
HighCholesterol
Yes, when product MA or MS Yes / No String
PulmonaryDisease
Yes, when product MA or MS Yes / No String
VascularDisease
Yes, when product MA or MS Yes / No String
AIDSHIV
Yes, when product MA or MS Yes / No String
KidneyDisease
Yes, when product MA or MS Yes / No String
Asthma
Yes, when product MA or MS Yes / No String
Cancer
Yes, when product MA or MS Yes / No String
Depression
Yes, when product MA or MS Yes / No String
Diabetes
Yes, when product MA or MS Yes / No String
HeartDisease
Yes, when product MA or MS Yes / No String
LiverDisease
Yes, when product MA or MS Yes / No String
HighBloodPressure
Yes, when product MA or MS Yes / No String
MentalIllness
Yes, when product MA or MS Yes / No String
Stroke Yes, when product MA or MS Yes / No String
Alzheimer
Yes, when product MA or MS Yes / No String
AlcoholAbuse
Yes, when product MA or MS Yes / No String
Hospitalized No Yes / No String
Pregnant No Yes / No String
Smoker No Yes / No String
Alcoholabstain No Yes / No String
Field1 No Free text field String
Field2 No Free text field String
Field3 No Free text field String
Field4 No Free text field String
Field5 No Free text field String
Field6 No Free text field String
Field7 No Free text field String
Field8 No Free text field String
Field9 No Free text field String
Field10 No Free text field String

PX responds with accurate feedback on how to update your request for it to be accepted by the API.

Success


{
    "TransactionId": "50cd75f6-85ac-4f0c-85a1-8b42e2a9135e",
    "MatchPingId": null,
    "Success": true,
    "Payout": null,
    "Message": null,
    "Errors": null,
    "Sold": null,
    "RedirectUrl": null,
    "BuyerRawResponse": null,
    "BuyerGuid": null,
    "Environment": "Testing",
    "Legs": null,
    "Brands": null
}


<Result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <TransactionId>6e3be8b2-ba70-4c1d-9a26-2d407beb3144</TransactionId>
    <Success>true</Success>
    <Payout xsi:nil="true" />
    <Sold xsi:nil="true" />
    <BuyerGuid xsi:nil="true" />
    <Environment>Testing</Environment>
</Result>

Failure


{
    "TransactionId": "49CE4DB7-775B-405B-BBBD-B23FB003073A",
    "Success": false,
    "Payout": null,
    "Message": "BadRequest",
    "Errors": [
        
    ]
    "Sold": null,
    "RedirectUrl": null,
    "BuyerRawResponse": null,
    "Environment": null,
    "Legs": null
}


<?xml version="1.0" encoding="UTF-8"?>
<Result xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <TransactionId>49CE4DB7-775B-405B-BBBD-B23FB003073A</TransactionId>
   <Success>false</Success>
   <Payout xsi:nil="true" />
   <Message>BadRequest</Message>
   <Errors>
      
   </Errors>
   <Sold xsi:nil="true" />
</Result>

The responses from our API shows if a Ping/Post has been successful or not, and if the lead wasn’t successful, why the Ping/Post has been rejected.

  • The “Message” parameter gives a general error code.
  • The “Errors” parameter gives the specific cause of the error, such as an invalid or missing value for a specific field.

If the Ping/Post was unsuccessful, the Payout and Sold field will show a “Null” value.

RespondOnNoSale

When this is set to False, the API will NOT perform a callback to your SellResponseURL in case we could not sell the LEAD.

SellResponseURL

Our API does not provide info about the lead being sold or not with Direct Post and Call & Lead (Ping Post Call) posts.

If not empty, this is the (Postback) URL, that you specify, that will be called by the API to inform you about the final results of the posted Lead. Please consult this article in our knowledge base to setup the SellResponseURL.

There are 2 ways, depending on the SellResponseURL you specify: ‘standard’ and ‘with variables’.
In ‘standard’ we defined the lay-out. In ‘with variables’ you define the layout using our variable labels enclosed in curly brackets {}.
We will only return the variables that you specify.

standard: {SellResponseURL}TransactionId={transactionid}&Payout={payout}&Result={Result}&Reason={Reason}&Sub2ID={sub2id}
with variables: {SellResponseURL}yourvar={transactionid}&yourvar={payout}&yourvar={Result}&yourvar={Reason}&yourvar={sub2id}

States

AL AK AZ AR CA CO CT DE FL GA
HI ID IL IN IA KS KY LA ME MD
MA MI MN MS MO MT NE NV NH NJ
NM NY NC ND OH OK OR PA RI SC
SD TN TX UT VT VA WA WV WI WY

Implementing Brand Explicit Consent

Brand Explicit Consent ensures that consumers can give individual consent to specific advertisers, before the advertisers receive the lead. Leads with the brand included will be sold to a campaign from the scope of those that require brand consent and have a matching brand connected (either directly or through Parent-Alias & Alias-Parent-Alias relations). Implementing Brand Explicit Consent would require adding the Match Ping, a new type of ping that precedes the Direct Post.

Integrating the Match Ping

MatchPing is a new request type that happens before the lead submission and allows us to obtain a list of potentially eligible brands and their indicative bids. To get the list of potential brands for lead brand consent, we recommend to integrate MatchPing.

Changes to the Direct Post

The General Lead data structure is governed by vertical specs. With Brand Explicit Consent, there are a few additions to the Direct Post lead data structure:

  • MatchPingID should match the one obtained during Match Ping from PX. Can be non-unique if Match Ping results are re-used or empty if Match Ping wasn’t called at all
  • Brand identifiers in the new BrandConsent field supported are Name, PxId, and Uid. Only one identifier should be submitted per brand
  • The brand section can also be omitted fully (in this case, lead still will be accepted and sold to campaigns that do not require brand consent)

For additional information on the changes to a Direct Post in the Brand Explicit Consent Flow, please find more details here.

RelationshipToApplicant

  • Self
  • Spouse
  • Child
  • Sibling
  • Parent
  • Grandparent
  • Grandchild
  • Other

Occupation

  • Employeed
  • Government
  • Homemaker
  • Retired
  • Student Living w/ Parents
  • Student not Living w/ Parents
  • Unemployed
  • Military
  • Retail
  • Sales
  • Marketing
  • IT
  • Medical
  • Unknown
  • BusinessOwner
  • Student
  • SalesInside
  • SalesOutside
  • Scientist
  • OtherTechnical
  • MilitaryEnlisted
  • Architect
  • Other

Education

  • Bachelors Degree
  • Doctorate Degree
  • High school diploma
  • Masters Degree
  • Other
  • None
  • Some College
  • Associate Degree

CurrentPolicy

  • United Healthcare
  • Humana
  • BCBS plans
  • CVS Health
  • Kaiser Permanente
  • Cigna
  • Centene
  • Other

Implementing Jornaya LeadId

To start generating the Jornaya LeadId token on your leads from your page, a script needs to be added to your website. Follow the guidance on how to implement this script.

Implementing TrustedForm

To start generating the TrustedForm CertURL on your leads from your page, a script needs to be added to your website. Follow the guidance on how to implement this script.

Undersold

When leads are being sold to PX that have already been sold to another lead buyer, the undersold method should be used.
Add the following parameters to the request body:

  • OpenSlots – indicates the number of times this lead can still be sold;
  • Name / Hash – indicates to which buyer this lead has already been sold. These buyers won’t be taken into account in the bidding process

Lost bids

This request is initiated after the ping response is received and instructs our API what price the lead has been sold when our bid was lower. This helps us and our lead buyers to optimize the bids.
Lost bids Post URL: https://secureopenapi.px.com/px

Code examples


Post
<?xml version="1.0" encoding="utf-8"?>
<LeadData Target="Lead.RejectWinner" Partner="{Username}" Password="{password}" AffiliateId="{PublisherID}">
    <Payout>{payout}</Payout>
    <TransactionId>{TransactionId}</TransactionId>
</LeadData>


Post
{
    "type": "jsonwsp/request", 
    "version": "1.0", 
    "methodname": "Lead.RejectWinner", 
    "LeadData":
    {
        "Target" : "Lead.RejectWinner",
        "Partner" : "{Username}",
        "Password" : "{Password}",
        "AffiliateId" : "{PublisherID}",
        "Payout" : "{Payout}",
        "TransactionId" : "{TransactionId}"
    }
}

In addition, HTTP format can be used:

Post
https://secureopenapi.px.com/px?Command=HTTPPost&Target=Lead.RejectWinner&Partner={Username}&Password={Password}&AffiliateId={PublisherID}&Payout={Payout}&TransactiondId={TransactionId}

 

Fields table

Parameter Explanation Description (data type)
Target=”Lead.RejectWinner” This indicates that my system needs to treat this request as a price update and not a normal lead String
Partner The username used to login the account, specifically the account for this campaign (Not MasterAccount) String
Password The password used to login the account, specifically the account for this campaign (Not MasterAccount)  
AffiliateId The publisherID provided at the start of the integration String
Payout The price you sold the lead for to another buyer / the price we lost the lead to String
TransactionId The same as you would on the post. We return a TransactionId on the ping and you return this here to match ping with the lost bid. Should you have problems retrieving our TransactionId from the response it is also possible to parse your own unique id on the ping in the TransactionId parameter. String