### GET /links Source: https://docs.tolt.com/links/list/index Retrieves a list of links associated with a specific program. This endpoint supports filtering and expansion of related resources. ```APIDOC ## GET /links ### Description Retrieves a list of links. You can filter by `program_id` and optionally expand related resources like `partner` and `program`. ### Method GET ### Endpoint `/v1/links` ### Parameters #### Query Parameters - **program_id** (string) - Required - The ID of the program to filter links by. - **expand** (array[string]) - Optional - Specifies related resources to include in the response (e.g., `partner`, `program`). ### Request Example ```bash cURL theme={"system"} curl -X GET 'https://api.tolt.com/v1/links?program_id=prg_YRsbPDAKhWfdqJbFACheh' \ -H 'Authorization: Bearer ' ``` ```bash With Expand theme={"system"} curl -X GET 'https://api.tolt.com/v1/links?program_id=prg_YRsbPDAKhWfdqJbFACheh&expand[]=partner&expand[]=program' \ -H 'Authorization: Bearer ' ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **has_more** (boolean) - Indicates if there are more pages of results. - **total_count** (integer) - The total number of links matching the query. - **data** (array[Object]) - An array of link objects. - **id** (string) - Unique identifier for the link. - **param** (string) - Tracking parameter name. - **value** (string) - Tracking parameter value. - **partner_id** (string) - ID of the partner who owns the link. - **created_at** (string) - ISO 8601 timestamp of creation. - **updated_at** (string) - ISO 8601 timestamp of update. - **program_id** (string) - Program ID the link belongs to. - **organization_id** (string) - Organization ID. - **partner** (Object) - Expanded partner details (if requested). - **program** (Object) - Expanded program details (if requested). #### Response Example ```json Response theme={"system"} { "success": true, "has_more": true, "total_count": 45, "data": [ { "id": "lnk_dK9bzRGn46BhVgNFHD6fDgXW", "param": "ref", "value": "michael_scott", "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "created_at": "2025-01-15T14:30:00.000Z", "updated_at": "2025-01-15T14:30:00.000Z", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "organization_id": "org_JE3mfYNL9ci7sFaJazAv2" } ] } ``` ```json Expand Response theme={"system"} { "success": true, "has_more": true, "total_count": 45, "data": [ { "id": "lnk_dK9bzRGn46BhVgNFHD6fDgXW", "param": "ref", "value": "michael_scott", "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "created_at": "2025-01-15T14:30:00.000Z", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "organization_id": "org_JE3mfYNL9ci7sFaJazAv2", "partner": { "id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "first_name": "Michael", "last_name": "Scott", "email": "michael.scott@dundermifflin.com", "company_name": "Dunder Mifflin", "status": "active", "created_at": "2025-01-13T10:06:11.251Z" }, "program": { "id": "prg_YRsbPDAKhWfdqJbFACheh", "status": "active", "name": "Tolt's Partnership Program", "product_name": "Tolt", "subdomain": "affiliates", "type": "public", "currency_code": "USD", "created_at": "2024-03-05T10:28:08.984+00:00" } } ] } ``` ``` -------------------------------- ### Fetch Links with Expansion (cURL) Source: https://docs.tolt.com/links/list/index This snippet shows how to fetch links using cURL and expand related partner and program data. This provides richer details in the response by including nested objects for 'partner' and 'program'. ```bash curl -X GET 'https://api.tolt.com/v1/links?program_id=prg_YRsbPDAKhWfdqJbFACheh&expand[]=partner&expand[]=program' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Fetch Links (cURL) Source: https://docs.tolt.com/links/list/index This snippet demonstrates how to fetch links using cURL. It requires an API key and a program ID. The response includes basic link information. ```bash curl -X GET 'https://api.tolt.com/v1/links?program_id=prg_YRsbPDAKhWfdqJbFACheh' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### List Tracking Links Source: https://docs.tolt.com/links/list/index Retrieves a list of tracking links. You can filter, sort, and paginate the results. ```APIDOC ## GET /websites/tolt_links_list ### Description This endpoint lists all tracking links. ### Method GET ### Endpoint `https://api.tolt.com/websites/tolt_links_list` ### Parameters #### Query Parameters - **program_id** (string) - Required - The program ID from where you want to list the links - **partner_id** (string) - Optional - Only return links from this partner - **param** (string) - Optional - Filter links by tracking parameter name - **value** (string) - Optional - Filter links by tracking parameter value - **order** (asc | desc) - Optional - The order of the links to return by created_at. Default is desc - **expand** (array) - Optional - Specify which related objects to include in the response. Valid values are 'partner' and 'program'. Use expand[]=partner or expand[]=program to include the related objects. - **created_gte** (string) - Optional - Only return links created after this date - **created_lte** (string) - Optional - Only return links created before this date - **limit** (string) - Optional - A limit on the number of links to return. Default is 10, max is 100 - **starting_after** (string) - Optional - A cursor for use in pagination. starting_after is an object ID that defines your place in the list - **ending_before** (string) - Optional - A cursor for use in pagination. ending_before is an object ID that defines your place in the list ### Request Example ```json { "query": { "program_id": "program_abc", "partner_id": "partner_xyz", "order": "asc", "expand": ["partner"] } } ``` ### Response #### Success Response (200) - **links** (array) - A list of tracking link objects. - **meta** (object) - Pagination metadata. #### Response Example ```json { "links": [ { "id": "link_123", "program_id": "program_abc", "partner_id": "partner_xyz", "param": "utm_source", "value": "facebook", "url": "https://example.com?utm_source=facebook", "created_at": "2023-10-27T10:00:00Z", "partner": { "id": "partner_xyz", "name": "Example Partner" } } ], "meta": { "has_more": true, "next_starting_after": "link_456" } } ``` ``` -------------------------------- ### Expanded Links API Response (JSON) Source: https://docs.tolt.com/links/list/index This JSON object represents an expanded response from the Tolt Links API. In addition to the basic link information, it includes nested 'partner' and 'program' objects, providing detailed information about the associated partner and program. ```json { "success": true, "has_more": true, "total_count": 45, "data": [ { "id": "lnk_dK9bzRGn46BhVgNFHD6fDgXW", "param": "ref", "value": "michael_scott", "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "created_at": "2025-01-15T14:30:00.000Z", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "organization_id": "org_JE3mfYNL9ci7sFaJazAv2", "partner": { "id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "first_name": "Michael", "last_name": "Scott", "email": "michael.scott@dundermifflin.com", "company_name": "Dunder Mifflin", "status": "active", "created_at": "2025-01-13T10:06:11.251Z" }, "program": { "id": "prg_YRsbPDAKhWfdqJbFACheh", "status": "active", "name": "Tolt's Partnership Program", "product_name": "Tolt", "subdomain": "affiliates", "type": "public", "currency_code": "USD", "created_at": "2024-03-05T10:28:08.984+00:00" } } ] } ``` -------------------------------- ### Basic Links API Response (JSON) Source: https://docs.tolt.com/links/list/index This JSON object represents a standard response from the Tolt Links API. It indicates the success of the request, whether more results are available, the total count of matching links, and an array of link data objects. ```json { "success": true, "has_more": true, "total_count": 45, "data": [ { "id": "lnk_dK9bzRGn46BhVgNFHD6fDgXW", "param": "ref", "value": "michael_scott", "partner_id": "part_s7mbzRGn46BhVgNFHD6fDgXW", "created_at": "2025-01-15T14:30:00.000Z", "updated_at": "2025-01-15T14:30:00.000Z", "program_id": "prg_YRsbPDAKhWfdqJbFACheh", "organization_id": "org_JE3mfYNL9ci7sFaJazAv2" } ] } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.