Astoria Company Auto Loan Refinance Integration Instructions
Contents
- Introduction to Ping/Post
- Help / Support
- Ping
- Sending a Ping Request
- Ping Responses
- Sample Ping Code
- Post
- Sending a Post Request
- Post Responses
- Sample Post Code
- Common Mistakes
- Testing
IMPORTANT NOTE: PLEASE ENSURE YOU CAREFULLY FOLLOW THE TESTING INSTRUCTIONS ONCE YOU'VE COMPLETED THE INTEGRATION!
Introduction to Ping/Post
Auto Loan Refinance is a two-step integration process. Commonly, it is referred to as ping/post, i.e. first you send us a 'ping' (all data EXCEPT PII) and we respond with a bid (or outright rejection). Assuming we are the winning bidder, you would then 'post' the lead data (this time including PII), along with the <confirmation> code you received in the ping response.
Please review the following to complete the integration. When you believe you are ready, please follow these steps to test your integration, and then email us at tech@astoriacompany.com
Help / Support
For help or support, or if you have any questions during the integration, please email us at tech@astoriacompany.com
Ping:
What is a Ping?
A Ping is a call to our API with all of the lead data EXCEPT the PII. It's purpose is to determine if there is any interest in purchasing the lead, and if there is, to establish the price we would be willing to pay if a subsequent Post for the same lead is accepted.
IMPORTANT NOTE: TO ENSURE YOUR ACCOUNT IS NOT TEMPORARILY SUSPENDED BY OUR AUTO-THROTTLING MECHANISM, PLEASE DO NOT EXCEED 300 PINGS IN ANY 5 MINUTE PERIOD.
Field names and acceptable values
The absence of any required field () will result in an error. If you do not collect the data for a required field, please refer to the 'Suggested Default' column.
Preferred fields () may be omitted, but doing so could reduce a lead's chances of finding a buyer.
Optional fields () can be omitted without any major impact.
Field | Contents | Suggested Default | Required? |
---|---|---|---|
lead_type | Determines the type of lead. MUST be '7' for Auto Loan Refinance |
7 | ![]() |
lead_mode | Determines if the lead should be treated as a test lead or a live lead. 0 = TEST LEAD 1 = LIVE LEAD Click here for full testing instructions. |
![]() |
|
vendor_id | This is the VID code you were provided by Astoria; if you do not know it, please contact us. Please ensure you are using the correct code, otherwise your leads may be credited to another partner! |
![]() |
|
sub_id | Code of your choosing for your own tracking purposes, e.g. '123-ABC' This should enable us to distinguish your lead sources from each other, so that we can optimize lead flow to buyers. There is a maximum length of 35 characters, and it may only contain letters, numbers, underscores and hyphens. |
![]() |
|
tcpa_optin | Indicates whether or not the consumer was presented with, and accepted, unambiguous consent to be contacted via automated telephone systems pursuant to TCPA requirements. 0 = No 1 = Yes Click here for more information. |
0 | ![]() |
tcpa_text | Contains the TCPA language the consumer was presented with on the form where their information was submitted, e.g. 'By submitting this form…' Click here for more information. |
![]() |
|
universal_leadid | Unique LeadiD as generated by LeadiD.com, e.g. '3034002A-DAD3-A177-202E-79F6E50FC9E1' |
![]() |
|
origination_datetime | Date/time when lead was submitted by consumer, in format 'YYYY-MM-DD hh:mm:ss', e.g. '2021-01-18 04:44:29' |
![]() |
|
origination_timezone | The timezone for the date/time passed in origination_datetime. 1 = EST / EDT 2 = CST / CDT 3 = MST / MDT 4 = PST / PDT |
![]() |
|
ipaddress | Applicants IP address, e.g. '3.232.96.22' | ![]() |
|
user_agent | The user agent string for the browser used by the applicant when their information was submitted, e.g. 'CCBot/2.0 (https://commoncrawl.org/faq/)' |
![]() |
|
vendor_lead_id | Your internal ID for this lead (useful if we need to contact you about a specific lead and when processing returns), e.g. '11363097' |
![]() |
|
url | URL of form where lead was generated, e.g. 'http://ratechecker.com/auto-loan-refinance/' | ![]() |
|
minimum_price | Minimum price you would accept for this lead, no $ symbol or commas, e.g. '2.00' NOTE: For test leads (i.e. where lead_mode=0), our 'buyers' return very low prices (for safety). If you choose to include this optional parameter, then please set it to just '0.01' when testing to ensure you receive the expected responses. WARNING: Setting a minimum_price will cause you to sell fewer leads! |
![]() |
|
zip | Valid 5-digit US Zip Code. Can be used when lead_mode=0 to influence test results. Click here for full testing instructions. |
![]() |
|
residence_type | Applicants residence status. 0 = Own 1 = Rent |
1 | ![]() |
years_at_residence | Applicants years at residence. 0 = 0 Years 1 = 1 Year 2 = 2 Years 3 = 3 Years 4 = 4 Years 5 = 5 Years 6 = 6 Years 7 = 7 Years 8 = 8 Years 9 = 9 Years 10 = 10 or more Years |
3 | ![]() |
months_at_residence | Applicants months at residence. 0 = 0 Months 1 = 1 Month 2 = 2 Months 3 = 3 Months 4 = 4 Months 5 = 5 Months 6 = 6 Months 7 = 7 Months 8 = 8 Months 9 = 9 Months 10 = 10 Months 11 = 11 Months |
0 | ![]() |
home_payment | Housing Payment, greater than 99. No commas, decimals or dollar symbol, e.g. '750'. |
![]() |
|
dob | Applicants date of birth, in the format YYYY-MM-DD, e.g. '1995-11-13' | ![]() |
|
ssn | Applicants Social Security Number - exactly 9 digits, all numeric. | ![]() |
|
monthly_income | Applicants monthly income - no commas, decimals or dollar symbol, e.g. '5000'. The income requirement varies by buyer, and most buyers set this to a minimum of $2000. If you have a large amount of applicatons under $2000 then you may find your leads won't sell often. |
![]() |
|
loan_amount | Requested loan amount - no commas, decimals or dollar symbol, e.g. '10000'. | 10000 | ![]() |
phone_last_4 | Last 4 digits of primary_phone. REQUESTED ON PING ONLY! REQUIRED by one of our largest buyers. |
![]() |
|
primary_goal | Main purpose for refinancing car. 1 = Lower Monthly Payment 2 = Paydown other debts 3 = Overall Savings 4 = Other |
1 | ![]() |
Additional Requirements
To be considered for a loan, a customer must:
- Reside in the United States
- Be employed
Sending a Ping Request
Ping Request Using HTTP/1.1 POST
Our PING URL is https://api.astoriacompany.com/v2/ping/. Please do not begin posting with lead_mode=1 until we have manually verified your test data (in addition to our automatic validation process), and we've explicitly notified you that your campaign has been activated within our system. Any leads posted to the live address while your campaign is still in test mode will return an error and neither be counted nor returned.
The data in the request should be URLENCODED to ensure it is received as intended.
Example Request
URL: https://api.astoriacompany.com/v2/ping/
Content-Type: application/x-www-form-urlencoded
lead_type=7&lead_mode=0&vendor_id=76&sub_id=6&tcpa_optin=1&tcpa_text=By+submitting+this+form...&universal_leadid=3034002A-DAD3-A177-202E-79F6E50FC9E1&origination_datetime=2021-01-18+04%3A44%3A29&origination_timezone=1&ipaddress=3.232.96.22&user_agent=CCBot%2F2.0+%28https%3A%2F%2Fcommoncrawl.org%2Ffaq%2F%29&vendor_lead_id=11363097&url=http%3A%2F%2Fratechecker.com%2Fauto-loan-refinance%2F&zip=35222&residence_type=1&years_at_residence=3&months_at_residence=0&home_payment=500&dob=1995-11-13&ssn=123456789&monthly_income=5000&loan_amount=10000&primary_goal=1
Ping Responses
This is exact text that will definitely be present.
This indicates variable data, or nodes that may or may not be present.
Accept:
NOTE: An 'Accept' response on the PING does NOT indicate we purchased the lead, but ONLY that the lead has passed validation, has not been identified as a duplicate, and that we are responding with a bid for that lead. The 'Response' tag will always contain 'Accepted', but the 'Confirmation' code and the 'Price' will differ for each response.
<PingResponse> <Response>Accepted</Response> <Confirmation>12345678901</Confirmation> <Price>6.00</Price> </PingResponse>
Reject:
NOTE: There are many reasons why we might reject a ping - below you will see all the possible rejection responses. The 'Response' tag will always contain 'Rejected', and the 'Price' will always be '0.00'. The 'Confirmation' code will differ for each response.
For rejected responses, we also add two extra tags: 'Reason' tells you why the lead was rejected, and 'Message' gives some more descriptive text.
Also, where 'Reason' is 'Errors Detected', we add an 'Errors' section with a separate 'Error' node for each error - see the example below! This is designed to help you troubleshoot and fix any errors found.
<PingResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>No Buyers Found</Reason>
<Message>There were no buyers available to bid on this lead</Message>
</PingResponse>
<PingResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>No Buyers Found</Reason>
<Message>Bids do not meet minimum_price requirement</Message>
</PingResponse>
<PingResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Maintenance Mode</Reason>
<Message>Our system is currently in maintenance mode</Message>
</PingResponse>
<PingResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Post data is empty</Reason>
<Message>Please check your integration</Message>
</PingResponse>
<PingResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Invalid lead_type</Reason>
<Message>Please pass a valid lead_type as per our specs</Message>
</PingResponse>
<PingResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Invalid lead_type for this vendor_id</Reason>
<Message>You are not currently approved to send leads of the given lead_type</Message>
</PingResponse>
<PingResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Invalid lead_mode</Reason>
<Message>Please ensure lead_mode is either '0' for TEST or '1' for LIVE</Message>
</PingResponse>
<PingResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Invalid vendor_id</Reason>
<Message>Please check the vendor_id is correct</Message>
</PingResponse>
<PingResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Provided vendor_id is in TEST MODE</Reason>
<Message>Please contact us if you believe your account should be in LIVE MODE</Message>
</PingResponse>
<PingResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Daily Cap Exhausted</Reason>
<Message>Please contact us to increase your daily cap</Message>
</PingResponse>
<PingResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Per Minute Cap Exhausted</Reason>
<Message>Please contact us to increase your per minute cap</Message>
</PingResponse>
<PingResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Errors Detected</Reason>
<Message>The following errors were detected in this lead:</Message>
<Errors>
<Error>1</Error>
<Error>2</Error>
<Error>3</Error>
</Errors>
</PingResponse>
<PingResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Duplicate Lead</Reason>
<Message>Lead was identified as a duplicate in our system</Message>
</PingResponse>
<PingResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Blacklisted Data</Reason>
<Message>The lead matches data on our internal blacklist - please investigate the lead source</Message>
</PingResponse>
Sample Ping Code
Here is some sample PHP code to help you create your call to our API. This is simple stuff, so you should be able to readily convery it into another programming language if necessary.
$apiUrl = 'https://api.astoriacompany.com/v2/ping/';
$headers = array('Content-Type: application/x-www-form-urlencoded');
$request = 'lead_type=7&lead_mode=0&vendor_id=76&sub_id=6&tcpa_optin=1&tcpa_text=By+submitting+this+form...&universal_leadid=3034002A-DAD3-A177-202E-79F6E50FC9E1&origination_datetime=2021-01-18+04%3A44%3A29&origination_timezone=1&ipaddress=3.232.96.22&user_agent=CCBot%2F2.0+%28https%3A%2F%2Fcommoncrawl.org%2Ffaq%2F%29&vendor_lead_id=11363097&url=http%3A%2F%2Fratechecker.com%2Fauto-loan-refinance%2F&zip=35222&residence_type=1&years_at_residence=3&months_at_residence=0&home_payment=500&dob=1995-11-13&ssn=123456789&monthly_income=5000&loan_amount=10000&primary_goal=1';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $apiUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($ch);
curl_close($ch);
Post:
What is a Post?
A Post is a call to our API with all of the lead data INCLUDING the PII. It's purpose is to attempt delivery of the actual lead to us, for the price established on the ping.
Field names and acceptable values
The absence of any required field () will result in an error. If you do not collect the data for a required field, please refer to the 'Suggested Default' column.
Preferred fields () may be omitted, but doing so could reduce a lead's chances of finding a buyer.
Optional fields () can be omitted without any major impact.
To make things easier for you, we have highlighted in green the additional fields that were not included in the Ping, but need to be added for the Post to pass validation.
Field | Contents | Suggested Default | Required? |
---|---|---|---|
confirmation_id | Astoria provided <Confirmation> code from corresponding ping repsonse. MUST be provided on Post, else it will be treated as a fresh Ping. |
![]() |
|
lead_type | Determines the type of lead. MUST be '7' for Auto Loan Refinance |
7 | ![]() |
lead_mode | Determines if the lead should be treated as a test lead or a live lead. 0 = TEST LEAD 1 = LIVE LEAD Click here for full testing instructions. |
![]() |
|
vendor_id | This is the VID code you were provided by Astoria; if you do not know it, please contact us. Please ensure you are using the correct code, otherwise your leads may be credited to another partner! |
![]() |
|
sub_id | Code of your choosing for your own tracking purposes, e.g. '123-ABC' This should enable us to distinguish your lead sources from each other, so that we can optimize lead flow to buyers. There is a maximum length of 35 characters, and it may only contain letters, numbers, underscores and hyphens. |
![]() |
|
tcpa_optin | Indicates whether or not the consumer was presented with, and accepted, unambiguous consent to be contacted via automated telephone systems pursuant to TCPA requirements. 0 = No 1 = Yes Click here for more information. |
0 | ![]() |
tcpa_text | Contains the TCPA language the consumer was presented with on the form where their information was submitted, e.g. 'By submitting this form…' Click here for more information. |
![]() |
|
universal_leadid | Unique LeadiD as generated by LeadiD.com, e.g. '3034002A-DAD3-A177-202E-79F6E50FC9E1' |
![]() |
|
origination_datetime | Date/time when lead was submitted by consumer, in format 'YYYY-MM-DD hh:mm:ss', e.g. '2021-01-18 04:44:29' |
![]() |
|
origination_timezone | The timezone for the date/time passed in origination_datetime. 1 = EST / EDT 2 = CST / CDT 3 = MST / MDT 4 = PST / PDT |
![]() |
|
ipaddress | Applicants IP address, e.g. '3.232.96.22' | ![]() |
|
user_agent | The user agent string for the browser used by the applicant when their information was submitted, e.g. 'CCBot/2.0 (https://commoncrawl.org/faq/)' |
![]() |
|
vendor_lead_id | Your internal ID for this lead (useful if we need to contact you about a specific lead and when processing returns), e.g. '11363097' |
![]() |
|
url | URL of form where lead was generated, e.g. 'http://ratechecker.com/auto-loan-refinance/' | ![]() |
|
minimum_price | Minimum price you would accept for this lead, no $ symbol or commas, e.g. '2.00' NOTE: For test leads (i.e. where lead_mode=0), our 'buyers' return very low prices (for safety). If you choose to include this optional parameter, then please set it to just '0.01' when testing to ensure you receive the expected responses. WARNING: Setting a minimum_price will cause you to sell fewer leads! |
![]() |
|
first_name | Applicants first name. | ![]() |
|
last_name | Applicants last name. | ![]() |
|
Email address | ![]() |
||
address | Street Address | ![]() |
|
zip | Valid 5-digit US Zip Code. Can be used when lead_mode=0 to influence test results. Click here for full testing instructions. |
![]() |
|
primary_phone | Primary phone number, exactly 10 digits (3 For PhoneAreaCode, 3 For PhoneExchange and 4 For PhoneSuffix ) no (), -, or spaces | ![]() |
|
secondary_phone | Secondary phone number, exactly 10 digits (3 For PhoneAreaCode, 3 For PhoneExchange and 4 For PhoneSuffix ) no (), -, or spaces | ![]() |
|
residence_type | Primary applicants residence status. 0 = Own 1 = Rent |
0 | ![]() |
years_at_residence | Primary applicants years at residence. 0 = 0 Years 1 = 1 Year 2 = 2 Years 3 = 3 Years 4 = 4 Years 5 = 5 Years 6 = 6 Years 7 = 7 Years 8 = 8 Years 9 = 9 Years 10 = 10 or more Years |
3 | ![]() |
months_at_residence | Primary applicants months at residence. 0 = 0 Months 1 = 1 Month 2 = 2 Months 3 = 3 Months 4 = 4 Months 5 = 5 Months 6 = 6 Months 7 = 7 Months 8 = 8 Months 9 = 9 Months 10 = 10 Months 11 = 11 Months |
0 | ![]() |
dob | Applicants date of birth, in the format YYYY-MM-DD, e.g. '1995-11-13' | ![]() |
|
ssn | Applicants Social Security Number - exactly 9 digits, all numeric. | ![]() |
|
employer | Name of the Company | ![]() |
|
job_title | Job title | ![]() |
|
work_phone | Work phone number, exactly 10 digits, no (), -, or spaces | ![]() |
|
employment_in_year | Number of years employed, 2-digits, e.g. '00' or '01', etc. | ![]() |
|
employment_in_month | Number of months employed, 2-digits, e.g. '00' or '01', etc; maximum value = '11'. | ![]() |
|
employment_type | Main source of income. 1 = Employed 2 = Self employed 3 = Fixed Income |
![]() |
|
monthly_income | Applicants monthly income - no commas, decimals or dollar symbol, e.g. '5000'. The income requirement varies by buyer, and most buyers set this to a minimum of $2000. If you have a large amount of applicatons under $2000 then you may find your leads won't sell often. |
![]() |
|
loan_amount | Requested loan amount - no commas, decimals or dollar symbol, e.g. '10000'. | 10000 | ![]() |
home_payment | Housing Payment, greater than 99. No commas, decimals or dollar symbol, e.g. '750'. |
![]() |
|
vehicle_year | The year of vehicle. From last 16 years, i.e. between 2005 and 2021, inclusive. Note that 2022 would be acceptable from August 1st, 2021. |
![]() |
|
vehicle_make | The make of vehicle, e.g. 'Audi' Click here to learn about our Vehicle API |
![]() |
|
vehicle_model | The model of vehicle, e.g. 'A6' Click here to learn about our Vehicle API |
![]() |
|
vehicle_vin | The VIN of vehicle, e.g. '1ACBC535*B*******' Not required if you use our Vehicle API to get a valid make and model. |
![]() |
|
vehicle_mileage | mileage of vehicle in numeric. e.g 10 | ![]() |
|
vehicle_lien_holder | Lienholder of vehicle being refinanced | ![]() |
|
loan_term | Number of months requested by applicant for loan term. only numeric, e.g. 12 | ![]() |
|
primary_goal | Main purpose for refinancing car. 1 = Lower Monthly Payment 2 = Paydown other debts 3 = Overall Savings 4 = Other |
1 | ![]() |
Additional Requirements
To be considered for a loan, a customer must:
- Reside in the United States
- Be employed
Sending a Post Request
Post Request Using HTTP/1.1 POST
Our POST URL is https://api.astoriacompany.com/v2/post/. Please do not begin posting with lead_mode=1 until we have manually verified your test data (in addition to our automatic validation process), and we've explicitly notified you that your campaign has been activated within our system. Any leads posted to the live address while your campaign is still in test mode will return an error and neither be counted nor returned.
The data in the request should be URLENCODED to ensure it is received as intended.
Example Request
URL: https://api.astoriacompany.com/v2/post/
Content-Type: application/x-www-form-urlencoded
lead_type=7&lead_mode=0&vendor_id=76&sub_id=6&tcpa_optin=1&tcpa_text=By+submitting+this+form...&universal_leadid=3034002A-DAD3-A177-202E-79F6E50FC9E1&origination_datetime=2021-01-18+04%3A44%3A29&origination_timezone=1&ipaddress=3.232.96.22&user_agent=CCBot%2F2.0+%28https%3A%2F%2Fcommoncrawl.org%2Ffaq%2F%29&vendor_lead_id=11363097&url=http%3A%2F%2Fratechecker.com%2Fauto-loan-refinance%2F&zip=35222&residence_type=1&years_at_residence=3&months_at_residence=0&dob=1995-11-13&ssn=123456789&monthly_income=5000&loan_amount=10000&primary_goal=1&first_name=John&last_name=Smith&email=test%40test.com&address=123+High+Street&primary_phone=6105551212&employer=Clothing+Emporium&job_title=Sales+Assistant&employment_in_year=2&employment_in_month=5&employment_type=1&work_phone=6105551515&home_payment=500&vehicle_year=2014&vehicle_make=Audi&vehicle_model=A6&vehicle_mileage=10&confirmation_id=12345
Post Responses
This is exact text that will definitely be present.
This indicates variable data, or nodes that may or may not be present.
Accept:
NOTE: An 'Accept' response on the POST indicates we HAVE purchased the lead. The 'Response' tag will always contain 'Accepted', but the 'Confirmation' code and the 'Price' will differ for each response.
<PostResponse> <Response>Accepted</Response> <Confirmation>12345678901</Confirmation> <Price>6.00</Price> </PostResponse>
Reject:
NOTE: There are many reasons why we might reject a post - below you will see all the possible rejection responses. The 'Response' tag will always contain 'Rejected', and the 'Price' will always be '0.00'. The 'Confirmation' code will differ for each response.
For rejected responses, we also add two extra tags: 'Reason' tells you why the lead was rejected, and 'Message' gives some more descriptive text.
Also, where 'Reason' is 'Errors Detected', we add an 'Errors' section with a separate 'Error' node for each error - see the example below! This is designed to help you troubleshoot and fix any errors found.
<PostResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Unable to Monetize</Reason>
<Message>All buyers rejected this lead (IF POSSIBLE, WE WILL ATTEMPT TO EXPLAIN WHY HERE)</Message>
</PostResponse>
<PostResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Unable to Monetize</Reason>
<Message>Bids do not meet minimum_price requirement</Message>
</PostResponse>
<PostResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Maintenance Mode</Reason>
<Message>Our system is currently in maintenance mode</Message>
</PostResponse>
<PostResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Post data is empty</Reason>
<Message>Please check your integration</Message>
</PostResponse>
<PostResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Invalid Confirmation ID</Reason>
<Message>You have passed a confirmation_id which is invalid</Message>
</PostResponse>
<PostResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Invalid lead_type</Reason>
<Message>Please pass a valid lead_type as per our specs</Message>
</PostResponse>
<PostResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Invalid lead_type for this vendor_id</Reason>
<Message>You are not currently approved to send leads of the given lead_type</Message>
</PostResponse>
<PostResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Invalid lead_mode</Reason>
<Message>Please ensure lead_mode is either '0' for TEST or '1' for LIVE</Message>
</PostResponse>
<PostResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Invalid vendor_id</Reason>
<Message>Please check the vendor_id is correct</Message>
</PostResponse>
<PostResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Provided vendor_id is in TEST MODE</Reason>
<Message>Please contact us if you believe your account should be in LIVE MODE</Message>
</PostResponse>
<PostResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Daily Cap Exhausted</Reason>
<Message>Please contact us to increase your daily cap</Message>
</PostResponse>
<PostResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Per Minute Cap Exhausted</Reason>
<Message>Please contact us to increase your per minute cap</Message>
</PostResponse>
<PostResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Errors Detected</Reason>
<Message>The following errors were detected in this lead:</Message>
<Errors>
<Error>1</Error>
<Error>2</Error>
<Error>3</Error>
</Errors>
</PostResponse>
<PostResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Duplicate Lead</Reason>
<Message>Lead was identified as a duplicate in our system</Message>
</PostResponse>
<PostResponse>
<Response>Rejected</Response>
<Confirmation>12345678901</Confirmation>
<Price>0.00</Price>
<Reason>Blacklisted Data</Reason>
<Message>The lead matches data on our internal blacklist - please investigate the lead source</Message>
</PostResponse>
Sample Post Code
Here is some sample PHP code to help you create your call to our API. This is simple stuff, so you should be able to readily convery it into another programming language if necessary.
$apiUrl = 'https://api.astoriacompany.com/v2/post/';
$headers = array('Content-Type: application/x-www-form-urlencoded');
$request = 'lead_type=7&lead_mode=0&vendor_id=76&sub_id=6&tcpa_optin=1&tcpa_text=By+submitting+this+form...&universal_leadid=3034002A-DAD3-A177-202E-79F6E50FC9E1&origination_datetime=2021-01-18+04%3A44%3A29&origination_timezone=1&ipaddress=3.232.96.22&user_agent=CCBot%2F2.0+%28https%3A%2F%2Fcommoncrawl.org%2Ffaq%2F%29&vendor_lead_id=11363097&url=http%3A%2F%2Fratechecker.com%2Fauto-loan-refinance%2F&zip=35222&residence_type=1&years_at_residence=3&months_at_residence=0&dob=1995-11-13&ssn=123456789&monthly_income=5000&loan_amount=10000&primary_goal=1&first_name=John&last_name=Smith&email=test%40test.com&address=123+High+Street&primary_phone=6105551212&employer=Clothing+Emporium&job_title=Sales+Assistant&employment_in_year=2&employment_in_month=5&employment_type=1&work_phone=6105551515&home_payment=500&vehicle_year=2014&vehicle_make=Audi&vehicle_model=A6&vehicle_mileage=10&confirmation_id=12345';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $apiUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($ch);
curl_close($ch);
Common Mistakes
- Values must be URL encoded. For example, james.doe@example.com should be james.doe%40example.com and 4 Pennsylvania Plaza should be 4+Pennsylvania+Plaza.
- All field names and explicitly allowed values (employment_in_month, is_rented, income_payment_type, etc.) are case-sensitive.
- Passing unlisted values (for example: family for reference_relationship1) will result in errors. Likewise, do not pass empty fields; instead omit the fields.
- Out-of-range or logically impossible values, like stay_in_month=100, or stay_in_year=100 when dob=1980, will fail.
- Remember to set lead_mode=1 when you go live!
Testing
For testing, i.e. when lead_mode=0, please attempt at least three different leads, each with a different zip code. One should end with and even number, one should end with an odd number, and one should end with a 0 (zero). The responses generated will vary based on the zip code used, as follows:
- If you PING a test lead with a zip code that ends with a ZERO (e.g. 19460), you will receive the 'No Coverage' response, i.e. it will be REJECTED on the PING.
- If you PING a test lead with a zip code that ends with an ODD number (e.g. 19461), you will receive a bid, i.e. it will be ACCEPTED on the PING. When you POST that same lead to us, it will be REJECTED on the POST.
- If you PING a test lead with a zip code that ends with an EVEN number (e.g. 19462), you will receive a bid. When you POST that same lead to us, it will be ACCEPTED on the POST.
Please email all of the ping and post requests AND their corresponding responses to tech@astoriacompany.com so that we can verify the tests and activate your account.
Testing via a Third Party Service
If you are having issues getting the response you expect, please use hurl.it or a similar service to hit our API with the following settings (refer to this image):
- Go to: hurl.it
- Select 'POST' in the first dropdown
- For the URL, enter: https://api.astoriacompany.com/v2/ping/ (or https://api.astoriacompany.com/v2/post/ if testing a post)
- Add a Header: 'Content-Type' with a value of 'application/x-www-form-urlencoded'
- Paste your ping or post request into the 'Parameters' text area
- Click: Launch Request