### Example GET Request Source: https://docs.pingtree.com/api-explore/database-source/create Shows how to send lead data as query parameters to the Create Lead API using the GET method. The Authorization header is still required. ```bash curl "https://api.pingtree.com/api/lead/create/64a1b2c3d4e5f6a7b8c9d0e1?first_name=Sarah&last_name=Connor&email=sarah.connor%40example.com&mobile=3105559876&zip_code=90210" \ -H "Authorization: Bearer sk_live_abc123xyz789..." ``` -------------------------------- ### Fetch Leads Example Request Source: https://docs.pingtree.com/documentation/database/source-api-help Example GET request to fetch leads, demonstrating filtering by status, date, and limit. Ensure the Authorization header is included. ```http GET /api/v1/database-source/home-insurance-leads/fetch?status=active&from_date=2025-01-01&limit=100 Authorization: Bearer YOUR_API_KEY ``` -------------------------------- ### Example Click Listing API Request Source: https://docs.pingtree.com/api-explore/offer-campaign/click-listing-api Demonstrates how to make a GET request to the Click Listing API using curl. Replace placeholders with your campaign and transaction IDs. ```bash curl "https://api.pingtree.com/api/click/list/cmp_9z8y7x6w/txn_7f3a2b1c-4d56-78ef-9012-abcdef123456" ``` -------------------------------- ### Example Request for Source List API Source: https://docs.pingtree.com/api-explore/offer-campaign/source-list-api Demonstrates how to make a GET request to the Source List API using curl, including authentication and query parameters for date filtering. ```bash curl -G "https://api.pingtree.com/api/source-list/org_5f1a2b3c/cmp_9z8y7x6w" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ --data-urlencode "from=2025-08-01" \ --data-urlencode "to=2025-08-31" ``` -------------------------------- ### Sample Campaign IDs Source: https://docs.pingtree.com/documentation/campaign/create-campaign Provides examples of valid Campaign IDs. ```text cp100 cp101 cp205 ``` -------------------------------- ### Example Source Ping API Request Source: https://docs.pingtree.com/api-explore/offer-campaign/source-ping-api Example cURL request demonstrating how to send lead data, including state, zip code, and custom parameters, to the Source Ping API. ```bash curl -X POST "https://api.pingtree.com/api/lead/ping/lnk_abc123xyz" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "state": "CA", "zip_code": "90001", "loan_amount": 15000, "credit_score": "good", "home_owner": true, "sub1": "pub-campaign-001" }' ``` -------------------------------- ### Campaign ID Format Example Source: https://docs.pingtree.com/documentation/campaign/create-campaign Illustrates the standard format for Campaign IDs. ```text cpXXX ``` -------------------------------- ### Array Object Mapping Example Source: https://docs.pingtree.com/documentation/campaign/distribution/custom-endpoints Demonstrates how to map objects within an array, using index notation to access and populate array elements. ```json { "items.0.name": "Apple", "items.0.quantity": 5, "items.1.name": "Banana", "items.1.quantity": 10 } ``` -------------------------------- ### Standard Tracking Script Installation Source: https://docs.pingtree.com/documentation/campaign/settings/click-script-sdk Add this script tag to the
of your landing page HTML. Replace {cid} with your campaign's unique ID. ```html ``` -------------------------------- ### Success Response - Ping Rejected (No Buyers) Source: https://docs.pingtree.com/api-explore/offer-campaign/source-ping-api Example JSON response when the ping request is rejected due to no available buyers for the lead. ```json { "status": "201", "message": "Ping rejected", "data": { "leadStatus": "ping_reject", "transaction_id": "txn_7f3a2b1c-4d56-78ef-9012-abcdef123456", "isDeDupe": false, "message": "No buyers available for this lead" } } ``` -------------------------------- ### Success Response - Lead Accepted Source: https://docs.pingtree.com/api-explore/offer-campaign/source-post-api Example of a successful response when a lead is accepted and recorded as unsold. ```json { "status": "201", "message": "Lead accepted", "transaction_id": "txn_7f3a2b1c-4d56-78ef-9012-abcdef123456", "data": { "transaction_id": "txn_7f3a2b1c-4d56-78ef-9012-abcdef123456", "leadStatus": "unsold", "redirect_url": "https://fallback.example.com" }, "isDeDupe": false } ``` -------------------------------- ### Example Tracking Event Request Source: https://docs.pingtree.com/api-explore/offer-campaign/global-event-postback Fire a non-conversion tracking event by omitting the revenue parameter. Ensure the event_id and transaction_id are correctly provided. ```bash curl -X POST "https://api.pingtree.com/api/event/global/org_5f1a2b3c" \ -H "Content-Type: application/json" \ -d '{ "event_id": "application_submitted", "transaction_id": "txn_7f3a2b1c-4d56-78ef-9012-abcdef123456" }' ``` -------------------------------- ### Trigger a Standard Event Source: https://docs.pingtree.com/api-explore/offer-campaign/event-postback Use this example to trigger a non-conversion event. Ensure 'cid', 'event_id', and 'transaction_id' are correctly provided. ```bash curl -X POST "https://api.pingtree.com/api/event/trigger" \ -H "Content-Type: application/json" \ -d '{ "cid": "cmp_9z8y7x6w", "event_id": "quote_viewed", "transaction_id": "txn_7f3a2b1c-4d56-78ef-9012-abcdef123456", "pid": "src_abc123" }' ``` -------------------------------- ### Nested Object Mapping Example Source: https://docs.pingtree.com/documentation/campaign/distribution/custom-endpoints Illustrates the structure for mapping nested objects, showing how to access properties within hierarchical data structures. ```json { "user": { "id": "user123", "profile": { "name": "Alice", "age": 30 } } } ``` -------------------------------- ### Success Response - No Leads Found Source: https://docs.pingtree.com/api-explore/database-source/fetch Example of a successful API response when no lead records match the query criteria. The 'leads' array will be empty. ```json { "status": 200, "message": "No leads found", "data": { "leads": [], "totalRecord": 0 } } ``` -------------------------------- ### GET /api/lead/create/{db-source-id} Source: https://docs.pingtree.com/api-explore/database-source/create Retrieves lead information or creates a lead record using query parameters. This endpoint can be used for testing or simple lead submissions. ```APIDOC ## GET /api/lead/create/{db-source-id} ### Description Retrieves lead information or creates a lead record using query parameters. This endpoint can be used for testing or simple lead submissions. ### Method GET ### Endpoint /api/lead/create/{db-source-id} ### Parameters #### Path Parameters - **db-source-id** (string) - Yes - MongoDB Object ID of the database source #### Query Parameters - **first_name** (string) - Conditional - Consumer's first name - **last_name** (string) - Conditional - Consumer's last name - **email** (string) - Conditional - Email address (validated as a valid email format) - **mobile** (string) - Conditional - 10-digit phone number (digits only) - **address** (string) - Conditional - Street address - **city** (string) - Conditional - City name (letters and spaces only) - **state** (string) - Conditional - 2-letter state abbreviation - **zip_code** (string) - Conditional - 5-digit ZIP code - **transaction_id** (string) - No - Custom transaction ID; auto-generated if omitted ### Request Example ``` https://api.pingtree.com/api/lead/create/64a1b2c3d4e5f6a7b8c9d0e1?first_name=Sarah&last_name=Connor&email=sarah.connor%40example.com&mobile=3105559876&zip_code=90210 ``` ### Response #### Success Response (200) - **status** (integer) - HTTP status code - **message** (string) - Description of the outcome - **data** (object) - Contains lead status and transaction ID - **leadStatus** (string) - Status of the lead (e.g., 'accept', 'duplicate') - **transaction_id** (string) - Unique identifier for the transaction #### Response Example ```json { "status": 200, "message": "Lead processed successfully", "data": { "leadStatus": "accept", "transaction_id": "db_txn_7f3a2b1c-4d56-78ef-9012-abcdef123456" } } ``` ``` -------------------------------- ### Success Response - Ping Accepted Source: https://docs.pingtree.com/api-explore/offer-campaign/source-ping-api Example JSON response when the ping request is accepted. Includes lead status, transaction ID, bid amount, and buyer terms. ```json { "status": "201", "message": "Ping accepted", "data": { "leadStatus": "ping_accept", "transaction_id": "txn_7f3a2b1c-4d56-78ef-9012-abcdef123456", "isDeDupe": false, "message": "Ping accepted", "amount": "45.00", "buyerTcpa": "By submitting this form you agree to be contacted by XYZ Lenders..." } } ``` -------------------------------- ### Example POST Request Source: https://docs.pingtree.com/api-explore/database-source/create Demonstrates how to send lead data as a JSON body to the Create Lead API using the POST method. Ensure the Authorization header and Content-Type are correctly set. ```bash curl -X POST "https://api.pingtree.com/api/lead/create/64a1b2c3d4e5f6a7b8c9d0e1" \ -H "Authorization: Bearer sk_live_abc123xyz789..." \ -H "Content-Type: application/json" \ -d '{ "first_name": "Sarah", "last_name": "Connor", "email": "sarah.connor@example.com", "mobile": "3105559876", "address": "999 Future Rd", "city": "Los Angeles", "state": "CA", "zip_code": "90210" }' ``` -------------------------------- ### Full HTML Integration Example Source: https://docs.pingtree.com/api-explore/offer-campaign/click-listing-iframe A complete HTML page demonstrating the integration of the Click Listing iFrame. Ensure your iFrame source URL and dimensions are correctly set. ```html