### Update Credential Example (Python) Source: https://developers.activeprospect.com/api-reference/account/update-a-credential This example shows how to update a credential using the Python SDK. Make sure the SDK is installed and properly initialized. ```python from your_sdk_package import CredentialsClient client = CredentialsClient() credential_id = 'credential_id_to_update' updated_data = { 'username': 'new_username', 'password': 'new_password' } try: response = client.update(credential_id, updated_data) print(f'Credential updated successfully: {response}') except Exception as e: print(f'Error updating credential: {e}') ``` -------------------------------- ### Complete Buyer Delivery Setup Source: https://developers.activeprospect.com/api-reference/onboards/complete-buyer-delivery-setup This endpoint is used to finalize the setup for delivering leads to a buyer. It is part of the onboarding process for new integrations. ```APIDOC ## POST /onboard/buyer ### Description Completes the buyer delivery setup process, finalizing the configuration for lead distribution to a buyer. ### Method POST ### Endpoint /onboard/buyer ### Request Body This endpoint does not explicitly define a request body in the provided OpenAPI schema. However, typical integrations might involve sending buyer-specific configuration details or confirmation signals. ### Response #### Success Response (200 OK) Indicates that the buyer delivery setup has been successfully completed. #### Error Response (e.g., 400 Bad Request, 401 Unauthorized, 500 Internal Server Error) Details about potential errors are not explicitly provided in the schema, but standard HTTP error codes would apply. ``` -------------------------------- ### Complete Buyer Onboarding Setup Source: https://developers.activeprospect.com/api-reference/onboards/complete-buyer-delivery-setup Completes the buyer onboarding setup by providing either a connection ID or an invitation ID. An optional flow ID can also be provided to use an existing flow. ```APIDOC ## POST /onboards/complete-buyer-delivery ### Description Completes the buyer onboarding setup. Requires either `connection_id` or `invitation_id`. ### Method POST ### Endpoint /onboards/complete-buyer-delivery ### Request Body - **connection_id** (string) - Required if `invitation_id` is not provided. The connection ID for the buyer setup. Example: `64b8f0f5e4b0c3a1d5e6f7a8` - **invitation_id** (string) - Required if `connection_id` is not provided. The invitation ID for the buyer setup. Example: `64b8f0f5e4b0c3a1d5e6f7a9` - **flow_id** (string) - Optional. The existing flow ID to use for buyer delivery. Example: `64b8f0f5e4b0c3a1d5e6f7aa` ### Request Example ```json { "connection_id": "64b8f0f5e4b0c3a1d5e6f7a8", "flow_id": "64b8f0f5e4b0c3a1d5e6f7aa" } ``` ### Response #### Success Response (200) - **redirect** (string) - The URL path to redirect the user to after successful setup. Example: `/flows/64b8f0f5e4b0c3a1d5e6f7a8` #### Response Example ```json { "redirect": "/flows/64b8f0f5e4b0c3a1d5e6f7a8" } ``` #### Error Responses - **404 Not Found**: Returned if the connection, invitation, or buyer flow is not found. - **500 Internal Server Error**: Returned if the buyer flow update fails. ``` -------------------------------- ### Update Credential Example (Node.js) Source: https://developers.activeprospect.com/api-reference/account/update-a-credential This snippet demonstrates how to update a credential using the Node.js SDK. Ensure you have the SDK installed and configured. ```javascript const credentials = require('your-sdk-package'); async function updateCredential() { try { const credentialId = 'credential_id_to_update'; const updatedData = { username: 'new_username', password: 'new_password' }; const response = await credentials.update(credentialId, updatedData); console.log('Credential updated successfully:', response); } catch (error) { console.error('Error updating credential:', error); } } updateCredential(); ``` -------------------------------- ### Firehose Configuration Migration Example Source: https://developers.activeprospect.com/api-reference/caps-and-limits/fetch-a-ping-limit-counter This example shows the migration of a firehose configuration from an older format to a newer one, introducing a nested 'services' object for AWS. ```json { "firehose": { "enabled": true, "credential_id": "507f1f77bcf86cd799439011", "bucket": "my-bucket" } } ``` ```json { "firehose": { "enabled": true, "services": { "aws": { "enabled": true, "credential_id": "507f1f77bcf86cd799439011", "bucket": "my-bucket" } } } } ``` -------------------------------- ### Complete buyer delivery setup Source: https://developers.activeprospect.com/llms.txt Completes the buyer delivery setup process for a connection. This endpoint performs several operations. ```APIDOC ## Complete buyer delivery setup ### Description Finalizes the buyer delivery setup for a given connection. ### Method POST ### Endpoint /onboard/buyer/complete ### Parameters #### Request Body - **connection_id** (string) - Required - The ID of the connection to complete setup for. ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the setup is complete. ### Response Example ```json { "message": "Buyer delivery setup completed successfully." } ``` ``` -------------------------------- ### Router Guards Example Source: https://developers.activeprospect.com/api-reference/routers/create-a-router Shows how to use route guards to control access to routes. This example uses a 'CanActivate' guard to protect a route. ```javascript const routes: Routes = [ { path: 'admin', component: AdminComponent, canActivate: [AuthGuard] } ]; ``` -------------------------------- ### Example Flow Fields Source: https://developers.activeprospect.com/api-reference/flows/create-a-new-flow This example shows the required format for the `fields` parameter when creating a flow. It is a list of field IDs that represent the lead data to be processed. ```json [ "first_name", "last_name", "email", "phone_1", "address_1", "city", "state", "postal_code", "trustedform_cert_url" ] ``` -------------------------------- ### Certificate URL Example Source: https://developers.activeprospect.com/api-reference/trustedform/v4/certificate-url This is an example of a Certificate URL. Each URL acts as an endpoint to a simple RPC API for interacting with individual certificates. ```APIDOC ## Certificate URL Each Certificate URL acts as the endpoint to a simple RPC API. The HTTP methods listed in this section are used to interact with an individual certificate. Certificate URLs follow a common format, though the format of a certificate ID depends on how the certificate was issued. ### Example URL ``` https://cert.trustedform.com/eb9fc4dd9bed9ad451a5648946cf4bf09b5bb947 ``` ``` -------------------------------- ### HTTP Basic Authentication Example Source: https://developers.activeprospect.com/pages/leadconduit/authentication This example demonstrates how to authenticate API requests using HTTP Basic Authentication with `curl`. The `-u` flag is used to provide the username (API) and your account API key. ```APIDOC ## HTTP Basic Authentication ### Description All calls to resources exposed by the ActiveProspect APIs require authentication using HTTP Basic Authentication. The username can be set to 'API' (as shown in examples) and the password should be your account API key. ### Method GET ### Endpoint https://app.leadconduit.com/flows ### Request Example ```bash curl -X GET -uAPI:YOUR_API_KEY -H 'Accept: application/json' https://app.leadconduit.com/flows ``` ### Response Example (Success response depends on the endpoint, this is a general authentication example) ```json { "flows": [ // ... flow objects ... ] } ``` ### Failure to Authenticate When authentication fails, you will receive an HTTP 401 (Unauthorized) response. #### Response Example (401 Unauthorized) ```json { "error": "authentication failed" } ``` ``` -------------------------------- ### Get Funnel Event Metrics Source: https://developers.activeprospect.com/api-reference/events/get-funnel-event-metrics This example demonstrates how to retrieve funnel event metrics using the LeadConduit API. ```APIDOC ## GET /events/event-metrics/funnel ### Description Retrieves funnel event metrics for a given flow. ### Method GET ### Endpoint /events/event-metrics/funnel ### Query Parameters - **flow_id** (string) - Required - The ID of the flow for which to retrieve funnel event metrics. ### Response #### Success Response (200) - **metrics** (object) - An object containing the funnel event metrics. - **total_leads** (integer) - The total number of leads processed. - **conversions** (integer) - The number of leads that completed the funnel. - **conversion_rate** (number) - The percentage of leads that converted. #### Response Example ```json { "metrics": { "total_leads": 1000, "conversions": 250, "conversion_rate": 0.25 } } ``` ``` -------------------------------- ### List All Flows Source: https://developers.activeprospect.com/api-reference/flows/list-all-flows This example demonstrates how to list all available flows using the API. ```APIDOC ## GET /flows ### Description Retrieves a list of all available flows. ### Method GET ### Endpoint /flows ### Response #### Success Response (200) - **flows** (array) - A list of flow objects. - **id** (string) - The unique identifier of the flow. - **name** (string) - The name of the flow. - **description** (string) - A brief description of the flow. - **created_at** (string) - The timestamp when the flow was created. - **updated_at** (string) - The timestamp when the flow was last updated. ### Response Example { "flows": [ { "id": "flow_123", "name": "Welcome Email Flow", "description": "Sends a welcome email to new users.", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z" }, { "id": "flow_456", "name": "Lead Nurturing Flow", "description": "Nurtures leads through a series of emails.", "created_at": "2023-10-27T11:00:00Z", "updated_at": "2023-10-27T11:00:00Z" } ] } ``` -------------------------------- ### Extract Substring (Start Only) Source: https://developers.activeprospect.com/api-reference/account/create-user-settings Extract a portion of a string starting from a specified index to the end of the string using the `substring` helper with only the `start` parameter. ```handlebars {{substring lead.first_name start="3"}} ``` -------------------------------- ### Extract Substring (Start and End) Source: https://developers.activeprospect.com/api-reference/account/create-user-settings Extract a portion of a string between a specified start and end index using the `substring` helper with both `start` and `end` parameters. ```handlebars {{substring lead.first_name start="2" end="4"}} ``` -------------------------------- ### Create Onboard Source: https://developers.activeprospect.com/api-reference/onboards/create-a-new-onboard Creates a new onboard record to track a buyer connection setup process. Requires an invitation_id which will be used to retrieve the associated connection. ```APIDOC ## POST /onboards ### Description Creates a new onboard record to track a buyer connection setup process. Requires an invitation_id which will be used to retrieve the associated connection. ### Method POST ### Endpoint /onboards ### Request Body - **invitation_id** (string) - Required - The invitation ID to create the onboard from. Must be a 24-character hexadecimal string. - **flow_id** (string) - Optional - The flow ID to use for the onboard if the UI already has it. Must be a 24-character hexadecimal string. ### Request Example ```json { "invitation_id": "64b8f0f5e4b0c3a1d5e6f7a8" } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier for the onboard record. - **account_id** (string) - The account ID that owns this onboard. - **invitation_id** (string) - The invitation ID associated with this onboard. - **connection_id** (string) - The connection ID used for the onboard (retrieved from the invitation). - **flow_id** (string) - The flow ID to be used for the onboard. - **status** (string) - Current status of the onboard process (e.g., created, in_progress, completed). - **created_at** (string) - Timestamp when the onboard was created. - **updated_at** (string) - Timestamp when the onboard was last updated. #### Response Example ```json { "id": "64b8f0f5e4b0c3a1d5e6f7a8", "account_id": "64b8f0f5e4b0c3a1d5e6f7a8", "invitation_id": "64b8f0f5e4b0c3a1d5e6f7a9", "connection_id": "64b8f0f5e4b0c3a1d5e6f7aa", "flow_id": "64b8f0f5e4b0c3a1d5e6f7ab", "status": "created", "created_at": "2023-07-20T10:00:00Z", "updated_at": "2023-07-20T10:00:00Z" } ``` #### Error Response (400) - **message** (string) - Description of the error (e.g., "Failed to get invitation by id", "Onboard already exists for this invitation"). #### Error Response (422) - **errors** (object) - An object containing validation errors. The keys are the field names, and the values are arrays of error messages. - **invitation_id** (array of strings) - Validation errors for the invitation_id field. #### Error Response (401) - Description: Authorization information is missing or invalid. #### Error Response (500) - **message** (string) - Description of the internal server error. ``` -------------------------------- ### Basic Router Creation Source: https://developers.activeprospect.com/api-reference/routers/create-a-router Demonstrates the fundamental steps to create a new router instance. This is the starting point for defining API endpoints. ```javascript import { Router } from "@angular/router"; export const routes: Routes = [ // Define your routes here ]; @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) export class AppRoutingModule { } ``` -------------------------------- ### Get report metadata Source: https://developers.activeprospect.com/llms.txt Get the metadata for a report that was shared. ```APIDOC ## Get report metadata ### Description Retrieves the metadata associated with a shared report. ### Method GET ### Endpoint /reports/{report_token}/metadata ### Parameters #### Path Parameters - **report_token** (string) - Required - The token of the shared report. ### Response #### Success Response (200) - **metadata** (object) - The metadata for the shared report. - **shared_by** (string) - The user or system that shared the report. - **shared_at** (string) - The timestamp when the report was shared. #### Response Example ```json { "metadata": { "shared_by": "user@example.com", "shared_at": "2023-10-27T10:00:00Z" } } ``` ``` -------------------------------- ### Flow Source Configuration Example Source: https://developers.activeprospect.com/api-reference/flows/create-a-new-flow This snippet shows a detailed configuration for a flow source, including integration settings, entity details, caps, ping limits, and pricing overrides. It is part of a larger flow creation payload. ```json { "name": "Sales Leads", "enabled": true, "fields": [ "first_name", "last_name", "email", "phone_1", "address_1", "city", "state", "postal_code", "trustedform_cert_url" ], "sources": [ { "integration": { "module_id": "", "mappings": [ { "property": "", "value": "", "id": "1aacd0", "rule_set": { "rules": [ { "lhv": "lead.state", "op": "is equal to", "rhv": "TX", "id": "1aacd0", "rule_set": "" } ], "id": "0d144a" } } ] }, "entity": { "id": "5fd4371e940df5a34a3888b2", "name": "", "time_zone": "America/New_York" }, "id": "1aacd0", "acceptance_criteria": { "rule_set": { "rules": [ { "lhv": "lead.state", "op": "is equal to", "rhv": "TX", "id": "1aacd0", "rule_set": "" } ], "id": "0d144a" }, "outcome": "failure", "reason": "Lead must live in TX" } } ] } ``` -------------------------------- ### Extract Substring (Start Only) Source: https://developers.activeprospect.com/api-reference/account/list-all-credentials Returns a substring from the specified start position to the end of the string. ```handlebars {{substring field_name start="3"}} ``` -------------------------------- ### Extract Substring (Start and End) Source: https://developers.activeprospect.com/api-reference/account/list-all-credentials Returns a substring from the specified start position to the specified end position. ```handlebars {{substring field_name start="2" end="4"}} ```