### 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 Your Personalized Offers

Here are your matched offers

``` -------------------------------- ### iFrame Embed Code Example Source: https://docs.pingtree.com/documentation/funnel-builder/click-listing-api This is an example of an auto-generated iframe code. It includes the transaction_id in the URL to render styled click listing UI tailored to lead data. ```html ``` -------------------------------- ### Example Routing Rule Source: https://docs.pingtree.com/documentation/campaign/distribution/routing-rules An example of a routing rule named 'High-Value California Leads'. This rule sends leads originating from 'google' with the state 'CA' to the 'California Premium Buyer' endpoint. ```text RULE NAME: High-Value California Leads GROUP A (AND): IF utm_source = "google" IF state = "CA" THEN SEND TO: • Endpoint "California Premium Buyer" ``` -------------------------------- ### GET /api/lead/list/{org-id}/{cid} Source: https://docs.pingtree.com/api-explore/offer-campaign/lead-list-api This OpenAPI definition describes the GET endpoint for retrieving a list of leads for a specific campaign. It includes parameters for filtering by date, pagination, and sorting, along with response schemas for success and various error conditions. ```yaml openapi: 3.1.0 info: title: Pingtree API Explore description: >- The Pingtree API Explore is a comprehensive guide designed to help you understand and integrate the Pingtree API effectively. It provides detailed insights into API endpoints, request parameters, and response structures to facilitate seamless lead distribution and tracking. Whether you're building custom integrations, automating lead flows, or optimizing campaign performance, this guide empowers you with the knowledge to leverage Pingtree's capabilities for enhanced lead management and improved results. license: name: MIT version: 1.0.0 servers: - url: https://api.pingtree.com security: [] paths: /api/lead/list/{org-id}/{cid}: get: description: >- The Campaign Lead List API retrieves a comprehensive list of leads linked to a particular campaign. This enables easy access to lead data for analysis, reporting, or follow-up tasks, ensuring campaign data is organized and accessible. parameters: - name: org-id required: true in: path description: Your organization ID schema: type: string - name: cid required: true in: path description: Your campaign unique ID schema: type: string - name: page in: query description: Selected page number default 1 schema: type: string - name: limit in: query description: 'No of leads in the page, default: 10, min:10, max:100' schema: type: string - name: sortField in: query description: Sort the list of leads based on field default _id schema: type: string - name: sortOrder in: query description: >- Sort order of list based on sort field default: descending, valid values are desc , asc schema: type: string - name: date required: true in: query description: >- For date filter anyone of these combination is rquired ["dateRange","singleDayDate","startDate and endDate"] from below list schema: type: string - name: dateRange in: query description: Valid date range format YYYY-MM-DD - YYYY-MM-DD schema: type: string - name: startDate in: query description: Valid startDate format YYYY-MM-DD schema: type: string - name: endDate in: query description: Valid endDate format YYYY-MM-DD schema: type: string - name: singleDayDate in: query description: Valid singleDayDate format YYYY-MM-DD schema: type: string responses: '201': description: Lead list successfully received content: application/json: schema: type: object properties: status: type: string description: Status code of API response type: type: string description: Type of API response which can be success or error message: type: string description: Message of API response leadsList: type: object description: Lead Details Array totalRecord: type: string description: Total leads count '400': description: >- Unexpected error, Campaign not found or Organization not found or Please enter valid date range content: application/json: schema: $ref: '#/components/schemas/lead-response' '401': description: Access token is missing or invalid content: application/json: schema: $ref: '#/components/schemas/lead-response' '429': description: >- Too many requests for fetch leads for organization Please wait 60 seconds before trying again content: application/json: schema: $ref: '#/components/schemas/lead-response' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/lead-response' security: - bearerAuth: [] components: schemas: lead-response: type: object properties: status: type: string ``` -------------------------------- ### Example Conversion Event Request Source: https://docs.pingtree.com/api-explore/offer-campaign/global-event-postback Send a POST request to the global event endpoint to fire a conversion event. Include the event_id, transaction_id, and optionally revenue. The organization ID is part of the URL. ```bash curl -X POST "https://api.pingtree.com/api/event/global/org_5f1a2b3c" \ -H "Content-Type: application/json" \ -d '{ "event_id": "sale_completed", "transaction_id": "txn_7f3a2b1c-4d56-78ef-9012-abcdef123456", "revenue": 85.00 }' ``` -------------------------------- ### Trigger a Conversion Event with Revenue Source: https://docs.pingtree.com/api-explore/offer-campaign/event-postback This example demonstrates how to trigger a conversion event and include the 'revenue' parameter for payout processing. The 'event_id' should be configured as a conversion type in your campaign settings. ```bash curl -X POST "https://api.pingtree.com/api/event/trigger" \ -H "Content-Type: application/json" \ -d '{ "cid": "cmp_9z8y7x6w", "event_id": "sale_completed", "transaction_id": "txn_7f3a2b1c-4d56-78ef-9012-abcdef123456", "pid": "src_abc123", "revenue": 45.00 }' ```