### Install Apideck Python SDKs Source: https://developers.apideck.com/guides/sdk-migration-python Compares the installation commands for the old 'apideck' package and the new 'apideck-unify' package using pip. ```bash # Old package pip install apideck # New package pip install apideck-unify ``` -------------------------------- ### PHP SDK Installation and Usage Source: https://developers.apideck.com/sdks/php Instructions on how to install the Apideck PHP SDK using Composer and a practical example demonstrating how to initialize the client and fetch CRM contacts. ```APIDOC ## PHP SDK Installation and Usage ### Description This section details the installation of the Apideck PHP SDK via Composer and provides a comprehensive example of its usage. The example demonstrates how to initialize the Apideck client with authentication credentials (bearer token, consumer ID, and app ID) and then make a request to list CRM contacts, including filtering, sorting, and passing through additional parameters. ### Method N/A (This is a usage guide, not a specific endpoint) ### Endpoint N/A (This is a usage guide, not a specific endpoint) ### Parameters #### Installation Command ```bash composer require "apideck-libraries/sdk-php" ``` #### SDK Initialization Parameters - **`setSecurity`** (string) - Required - Your Bearer Token for authentication. - **`setConsumerId`** (string) - Required - Your Consumer ID. - **`setAppId`** (string) - Required - Your Application ID. #### `crm->contacts->list` Request Parameters - **`serviceId`** (string) - Required - The ID of the CRM service (e.g., 'salesforce'). - **`filter`** (object) - Optional - An object containing filter criteria for contacts (e.g., `firstName`, `lastName`, `email`, `companyId`, `ownerId`). - **`firstName`** (string) - Optional - Filter by first name. - **`lastName`** (string) - Optional - Filter by last name. - **`email`** (string) - Optional - Filter by email address. - **`companyId`** (string) - Optional - Filter by company ID. - **`ownerId`** (string) - Optional - Filter by owner ID. - **`sort`** (object) - Optional - An object for sorting the results. - **`by`** (enum: `CreatedAt`, `UpdatedAt`, `FirstName`, `LastName`) - Required - The field to sort by. - **`direction`** (enum: `Asc`, `Desc`) - Required - The sort direction. - **`passThrough`** (object) - Optional - Additional parameters to pass through to the underlying API. - **`fields`** (string) - Optional - Comma-separated list of fields to include in the response. ### Request Example ```php setSecurity('') ->setConsumerId('') ->setAppId('') ->build(); $request = new Operations\CrmContactsAllRequest( serviceId: 'salesforce', filter: new Components\ContactsFilter( firstName: 'Elon', lastName: 'Musk', email: 'elon@tesla.com', companyId: '12345', ownerId: '12345', ), sort: new Components\ContactsSort( by: Components\ContactsSortBy::CreatedAt, direction: Components\SortDirection::Desc, ), passThrough: [ 'search' => 'San Francisco', ], fields: 'id,updated_at', ); $responses = $sdk->crm->contacts->list( request: $request ); foreach ($responses as $response) { if ($response->httpMeta->response->getStatusCode() === 200) { // handle response } } ?> ``` ### Response #### Success Response (200) - **`data`** (array) - An array of CRM contact objects. - **`next_page`** (string) - URL for the next page of results. - **`next_cursor`** (string) - Cursor for the next page of results. #### Response Example ```json { "data": [ { "id": "con_123", "first_name": "Elon", "last_name": "Musk", "email": "elon@tesla.com", "company_id": "12345", "owner_id": "12345", "created_at": "2023-01-01T10:00:00Z", "updated_at": "2023-01-01T10:00:00Z" } ], "next_page": null, "next_cursor": null } ``` ### Error Handling - **400 Bad Request**: Invalid request parameters. - **401 Unauthorized**: Invalid API key or authentication credentials. - **404 Not Found**: The requested resource or service was not found. - **500 Internal Server Error**: An unexpected error occurred on the server. ``` -------------------------------- ### Install Go SDK Source: https://developers.apideck.com/sdks Get the Apideck Go SDK using the go get command. This SDK simplifies integrating with Apideck's Unified APIs in Go applications. ```bash go get github.com/apideck-libraries/sdk-go ``` -------------------------------- ### Python SDK Installation and Usage Source: https://developers.apideck.com/sdks/python This section details how to install the Apideck Python SDK using pip and provides a comprehensive example of initializing the client and making an API call to list contacts. ```APIDOC ## Python SDK Installation and Usage ### Description This guide covers the installation and basic usage of the Apideck Python SDK. It demonstrates how to install the package, initialize the client with necessary credentials, and make a sample API request to retrieve a list of contacts with specific filters and sorting. ### Method N/A (SDK Usage) ### Endpoint N/A (SDK Usage) ### Parameters #### Initialization Parameters - **api_key** (string) - Required - Your Apideck API key. It's recommended to use environment variables. - **consumer_id** (string) - Required - The ID of the consumer. - **app_id** (string) - Required - The ID of your Apideck application. #### SDK Method Parameters (Example: `apideck.crm.contacts.list`) - **service_id** (string) - Required - The ID of the service (e.g., 'salesforce'). - **filter_** (object) - Optional - Filters to apply to the contact list. Supported fields include `first_name`, `last_name`, `email`, `company_id`, `owner_id`. - **sort** (object) - Optional - Sorting options for the contact list. Includes `by` (e.g., `ContactsSortBy.CREATED_AT`) and `direction` (e.g., `SortDirection.DESC`). - **pass_through** (object) - Optional - Additional parameters to pass through to the underlying API. - **fields** (string) - Optional - Comma-separated list of fields to include in the response. ### Request Example ```python import apideck_unify from apideck_unify import Apideck import os with Apideck( api_key=os.getenv("APIDECK_API_KEY", ""), consumer_id="", app_id="", ) as apideck: res = apideck.crm.contacts.list(service_id="salesforce", filter_={ "first_name": "Elon", "last_name": "Musk", "email": "elon@tesla.com", "company_id": "12345", "owner_id": "12345", }, sort={ "by": apideck_unify.ContactsSortBy.CREATED_AT, "direction": apideck_unify.SortDirection.DESC, }, pass_through={ "search": "San Francisco", }, fields="id,updated_at") while res is not None: # Handle items print(res.data) res = res.next() ``` ### Response #### Success Response (200) - **data** (array) - A list of contact objects matching the query. - **next_page** (string) - A token for fetching the next page of results. #### Response Example ```json { "data": [ { "id": "con_123", "updated_at": "2023-10-27T10:00:00Z", "first_name": "Elon", "last_name": "Musk", "email": "elon@tesla.com", "company_id": "12345", "owner_id": "12345" } ], "next_page": "some_token_for_next_page" } ``` ``` -------------------------------- ### List DriveGroups API Request Example Source: https://developers.apideck.com/apis/file-storage/reference This example demonstrates how to make a GET request to the List DriveGroups API endpoint. It includes common header parameters like x-apideck-consumer-id and x-apideck-app-id, as well as optional query parameters for filtering and pagination. ```http GET https://unify.apideck.com/file-storage/drive-groups Header: x-apideck-consumer-id: YOUR_CONSUMER_ID x-apideck-app-id: YOUR_APP_ID Query: limit: 20 cursor: "string" ``` -------------------------------- ### Install Apideck PHP SDK (Composer) Source: https://developers.apideck.com/guides/sdk-migration-php Instructions for installing the old and new Apideck PHP SDK packages using Composer. The new package name is `apideck-libraries/sdk-php`. ```bash # Old package composer require apideck-libraries/php-sdk # New package composer require apideck-libraries/sdk-php ``` -------------------------------- ### Install New Apideck SDK for Typescript Source: https://developers.apideck.com/guides/sdk-migration Installs the new @apideck/unify SDK and zod for Typescript projects. For Yarn users, zod is also installed. ```bash # Old package npm install @apideck/node # New package npm install @apideck/unify # For Yarn users, also install zod yarn add @apideck/unify zod ``` -------------------------------- ### Proxy API Request Example (Bash) Source: https://developers.apideck.com/apis/proxy/reference Demonstrates how to make a GET request to the Proxy API and handle a potential 301 redirect for large responses. This example uses cURL to illustrate the process, including setting necessary headers and following redirects. ```bash curl -X GET \ 'https://unify.apideck.com/proxy' \ -H 'Authorization: Bearer YOUR_API_KEY_HERE' \ -H 'x-apideck-app-id: YOUR_APP_ID_HERE' \ -H 'x-apideck-consumer-id: YOUR_CONSUMER_ID_HERE' \ -H 'x-apideck-downstream-url: YOUR_DOWNSTREAM_URL_HERE' \ -H 'x-apideck-downstream-method: GET' \ -L \ -o response.txt ``` -------------------------------- ### Get All Ledger Accounts - API Response Source: https://developers.apideck.com/guides/journal-entries-expenses-ledger-accounts-workday Example JSON response for the 'Get All Ledger Accounts' API call. It includes a list of ledger accounts, each with an ID, display ID, classification, name, status, and parent account information. ```json { "status_code": 200, "data": [ { "id": "eyJBY2NvdW50X0lkIjoiNjQwMCIsIkFjY291bnRfU2V0X0lkIjoiQ29ycG9yYXRlIn0=", "display_id": "6400", "classification": "expense", "name": "Professional Fees", "active": true, "status": "active", "parent_account": { "id": "eyJBY2NvdW50X0lkIjoiNjAwMCIsIkFjY291bnRfU2V0X0lkIjoiQ29ycG9yYXRlIn0=", "name": "Operating Expenses" } } ], "meta": { "items_on_page": 1, "cursors": { "previous": null, "current": "page=1", "next": "page=2" } } } ``` -------------------------------- ### Get Connections - Salesforce Example Source: https://developers.apideck.com/guides/authorize-connections Example response for a Get Connections call, showing Salesforce connection details and authorization URLs. ```APIDOC ## GET /connections/{id} ### Description Retrieves details for a specific connection, including its authorization URL. ### Method GET ### Endpoint /connections/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the connection. ### Response #### Success Response (200) - **data** (object) - Contains connection details. - **authorize_url** (string) - The URL to initiate the authorization flow. - **revoke_url** (string) - The URL to revoke the connection. #### Response Example ```json { "status_code": 200, "status": "OK", "data": { "id": "crm+salesforce", "service_id": "salesforce", "name": "Salesforce", "tag_line": "CRM software solutions and enterprise cloud computing from Salesforce, the leader in customer relationship management (CRM) and PaaS. Free 30 day trial.", "unified_api": "crm", "state": "authorized", "auth_type": "oauth2", "oauth_grant_type": "authorization_code", "status": "live", "enabled": true, "website": "https://www.salesforce.com", "icon": "https://res.cloudinary.com/apideck/image/upload/v1529456047/catalog/salesforce/icon128x128.png", "logo": "https://c1.sfdcstatic.com/content/dam/web/en_us/www/images/home/logo-salesforce-m.svg", "authorize_url": "https://unify.apideck.com/vault/authorize/salesforce/?state=", "revoke_url": "https://unify.apideck.com/vault/revoke/salesforce/?state=" } } ``` ``` -------------------------------- ### List Connections Request Example (TypeScript) Source: https://developers.apideck.com/apis/vault/reference Demonstrates how to list configured connections for a specific unified API using the Apideck SDK in TypeScript. It initializes the Apideck client with consumer and app IDs and an API key, then calls the `connections.list` method. ```typescript import { Apideck } from "@apideck/unify"; const apideck = new Apideck({ consumerId: "test-consumer", appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", apiKey: process.env["APIDECK_API_KEY"] ?? "", }); async function run() { const result = await apideck.vault.connections.list({ api: "crm", configured: true, }); console.log(result); } run(); ``` -------------------------------- ### Install Apideck Node.js SDK Source: https://developers.apideck.com/guides/file-picker This command installs the Apideck Node.js SDK using yarn. This SDK simplifies interactions with Apideck APIs, including creating sessions for services like the File Picker. ```bash yarn add @apideck/unify ``` -------------------------------- ### Install Apideck .NET SDK Source: https://developers.apideck.com/sdks/dot-net Installs the Apideck Unify SDK package using the .NET CLI. This is the first step to using the SDK in your .NET application. ```bash dotnet add package ApideckUnifySdk ``` -------------------------------- ### Get Invoices from FreeAgent API Source: https://developers.apideck.com/connectors/freeagent/docs/application_owner%2Boauth_credentials This example demonstrates how to make a GET request to the Invoices endpoint of the FreeAgent API using Apideck's Accounting API. ```APIDOC ## GET /accounting/invoices ### Description Retrieves a list of invoices from the FreeAgent API. ### Method GET ### Endpoint /accounting/invoices ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of records to return. - **cursor** (string) - Optional - Used for pagination to retrieve the next set of records. #### Headers - **x-apideck-consumer-id** (string) - Required - Your Apideck consumer ID. - **x-apideck-app-id** (string) - Required - Your Apideck App ID. - **x-apideck-service-id** (string) - Required - The service ID for FreeAgent (e.g., 'freeagent'). - **Authorization** (string) - Required - Bearer token for authentication (e.g., 'Bearer {APIDECK_API_KEY}'). - **Content-Type** (string) - Required - Set to 'application/json'. ### Request Example ```curl curl --location --request GET 'https://unify.apideck.com/accounting/invoices' \ --header 'x-apideck-consumer-id: test-consumer' \ --header 'x-apideck-app-id: {APIDECK_APP_ID}' \ --header 'x-apideck-service-id: freeagent' \ --header 'Authorization: Bearer {APIDECK_API_KEY}' \ --header 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **data** (array) - An array of invoice objects. - **id** (string) - The unique identifier for the invoice. - **invoice_number** (string) - The invoice number. - **status** (string) - The status of the invoice (e.g., 'draft', 'sent', 'paid'). - **currency** (string) - The currency of the invoice. - **total_amount** (number) - The total amount of the invoice. - **due_date** (string) - The due date of the invoice. - **next_page** (string) - URL for the next page of results, if available. #### Response Example ```json { "data": [ { "id": "inv_123", "invoice_number": "INV-001", "status": "paid", "currency": "USD", "total_amount": 150.00, "due_date": "2023-12-31" } ], "next_page": null } ``` ``` -------------------------------- ### Initialize Apideck PHP SDK Source: https://developers.apideck.com/guides/sdk-migration-php Demonstrates the difference in SDK initialization between the old and new Apideck PHP SDKs. The new SDK uses a builder pattern for configuration. ```php // Old SDK use Apideck\Client\Apideck; use Apideck\Client\ApideckConfiguration; $config = new ApideckConfiguration('', '', ''); $apideck = new Apideck($config); // New SDK use Apideck\Unify; $sdk = Unify\Apideck::builder() ->setConsumerId('test-consumer') ->setAppId('your-app-id') ->setSecurity('your-api-key') ->build(); ``` -------------------------------- ### Basic Dropdown Example with Options Source: https://developers.apideck.com/components/dropdown A basic example of how to use the Dropdown component from Apideck Components. It shows how to define the options for the dropdown using the 'options' prop, including labels and links. ```javascript import { Dropdown } from '@apideck/components' const options = [ { label: 'Add to Apideck', href: `https://platform.apideck.com` }, { label: 'Run in Postman', href: `https://app.getpostman.com/run-collection/1311564-22eb0345-7fcb-4358-88bc-af234ffc8943` }, { label: 'Run in Insomnia', href: `https://insomnia.rest/run?label=TrueLayer%20API&uri=https%3A%2F%2Fspecs.apideck.com%2Fcrm.yml` } ] export default function DropdownBasic() { return } ``` -------------------------------- ### GET /ecommerce/orders Source: https://developers.apideck.com/connectors/ebay/docs/application_owner%2Boauth_credentials Example cURL command to make your first API call to retrieve eBay orders. ```APIDOC ## GET /ecommerce/orders ### Description This endpoint retrieves a list of orders from the eBay API. ### Method GET ### Endpoint `/ecommerce/orders` ### Parameters #### Query Parameters (No query parameters are specified in the example) #### Request Body (This is a GET request, so no request body is expected) ### Request Example ```bash curl --location 'https://unify.apideck.com/ecommerce/orders' \ --header 'x-apideck-consumer-id: test-consumer' \ --header 'x-apideck-app-id: {APIDECK_APP_ID}' \ --header 'x-apideck-service-id: ebay' \ --header 'Authorization: Bearer {APIDECK_API_KEY}' ``` ### Response #### Success Response (200) (Response structure not detailed in the provided text) #### Response Example (Response example not provided in the input text) ``` -------------------------------- ### Python SDK Example (Conceptual) Source: https://developers.apideck.com/apis/hris/reference A conceptual example of how to use the Apideck Python SDK to interact with the HRIS API. This snippet assumes the SDK is installed and configured with necessary credentials. ```python from apideck import UnifiedApiClient client = UnifiedApiClient( api_key='YOUR_API_KEY_HERE', app_id='YOUR_APP_ID_HERE' ) def get_hris_employees(): try: response = client.hris.list_employees(limit=10) print(response.data) except Exception as e: print(f"Error fetching HRIS employees: {e}") get_hris_employees() ``` -------------------------------- ### Node.js SDK Example (Conceptual) Source: https://developers.apideck.com/apis/hris/reference A conceptual example of how to use the Apideck Node.js SDK to interact with the HRIS API. This snippet assumes the SDK is installed and configured with necessary credentials. ```javascript const apideck = require('@apideck/node'); const unifiedApi = apideck.createUnifiedApiClient({ apiKey: 'YOUR_API_KEY_HERE', appId: 'YOUR_APP_ID_HERE' }); async function getHrisData() { try { const response = await unifiedApi.hris.listEmployees({ limit: 10 }); console.log(response.data); } catch (error) { console.error('Error fetching HRIS data:', error); } } getHrisData(); ``` -------------------------------- ### Node.js SDK Example for API Authentication Source: https://developers.apideck.com/apis/lead/reference Provides a basic example of how to authenticate API requests using the Apideck Node.js SDK. This snippet demonstrates setting up the `consumerId`, `apiKey`, and `appId` for SDK initialization. ```javascript const { UnifiedApiClient } = require('@apideck/unified-api'); const unifiedApiClient = new UnifiedApiClient({ apiKey: 'YOUR_API_KEY_HERE', consumerId: 'YOUR_CONSUMER_ID_HERE', appId: 'YOUR_APP_ID_HERE' }); // Now you can use unifiedApiClient to make API calls ``` -------------------------------- ### Get All Expenses Source: https://developers.apideck.com/guides/journal-entries-expenses-ledger-accounts-workday Returns a list of expenses. ```APIDOC ## GET /accounting/expenses ### Description Returns a list of expenses. ### Method GET ### Endpoint /accounting/expenses ### Request Example ``` GET /accounting/expenses ``` ### Response #### Success Response (200) - **status_code** (integer) - The status code of the response. - **data** (array) - An array of expense objects. - **meta** (object) - Metadata about the pagination, including items on page and cursors for previous, current, and next pages. #### Response Example ```json { "status_code": 200, "data": [ { "id": "a10dee2ca7258147170cb396fe154022", "number": "10783", "transaction_date": "2025-01-15T00:00:00Z", "total_amount": 700.00, "type": "expense", "status": "posted", "currency": "USD", "account": { "id": "..." }, "line_items": [...], "created_at": "2025-01-15T14:23:10Z", "updated_at": "2025-01-15T14:23:10Z" } ], "meta": { "items_on_page": 1, "cursors": { "previous": null, "current": "page=1", "next": null } } } ``` ``` -------------------------------- ### Initialize Apideck Client and List Tax Rates in Go Source: https://developers.apideck.com/sdks/go This Go code snippet demonstrates how to initialize the Apideck client with API key, consumer ID, and app ID. It then shows how to make a request to list tax rates for a specific service, with optional filtering and passthrough parameters. ```go package main import ( "context" sdkgo "github.com/apideck-libraries/sdk-go" "github.com/apideck-libraries/sdk-go/models/components" "github.com/apideck-libraries/sdk-go/models/operations" "log" "os" ) func main() { s := sdkgo.New( sdkgo.WithSecurity(os.Getenv("")), sdkgo.WithConsumerID(""), sdkgo.WithAppID(""), ) ctx := context.Background() res, err := s.Accounting.TaxRates.List(ctx, operations.AccountingTaxRatesAllRequest{ ServiceID: sdkgo.String("salesforce"), Filter: &components.TaxRatesFilter{ Assets: sdkgo.Bool(true), Equity: sdkgo.Bool(true), Expenses: sdkgo.Bool(true), Liabilities: sdkgo.Bool(true), Revenue: sdkgo.Bool(true), }, PassThrough: map[string]any{ "search": "San Francisco", }, Fields: sdkgo.String("id,updated_at"), }) if err != nil { log.Fatal(err) } if res.GetTaxRatesResponse != nil { // handle response } } ``` -------------------------------- ### Python SDK Example for API Authentication Source: https://developers.apideck.com/apis/lead/reference Shows a Python example for authenticating API requests with the Apideck Python SDK. This code illustrates how to configure the SDK with your `consumerId`, `apiKey`, and `appId`. ```python from apideck import UnifiedApiClient client = UnifiedApiClient( api_key='YOUR_API_KEY_HERE', consumer_id='YOUR_CONSUMER_ID_HERE', app_id='YOUR_APP_ID_HERE' ) # Use the client object to interact with the API ``` -------------------------------- ### Checking Expense Status (GET Request) Source: https://developers.apideck.com/guides/journal-entries-expenses-ledger-accounts-workday Demonstrates how to retrieve the status of an expense using a GET request to `/accounting/expenses/{id}`. The response includes the 'status' and 'posted_at' fields. ```http GET /accounting/expenses/{id} ``` ```json { "id": "a10dee2ca7258147170cb396fe154022", "status": "posted", // Successfully posted "posted_at": "2025-01-15T00:00:00Z", "total_amount": 700.00, ... } ``` -------------------------------- ### Apideck Slash Commands for AI Tools Source: https://developers.apideck.com/building-with-llms These are examples of slash commands available through IDE plugins for AI coding tools. They allow users to perform common tasks like testing API connections, listing available connectors, and initializing API contract testing configurations. ```bash * **/test-connection** — Verify an Apideck connection with a test API call * **/list-connectors** — Show available connectors and capabilities for a unified API * **/portman-init** — Generate a Portman config for API contract testing ``` -------------------------------- ### Get One Expense Source: https://developers.apideck.com/guides/journal-entries-expenses-ledger-accounts-workday Retrieves a specific expense by its ID. ```APIDOC ## GET /accounting/expenses/{id} ### Description Retrieves a specific expense by its WID. ### Method GET ### Endpoint /accounting/expenses/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the expense. ### Response #### Success Response (200) - **status_code** (integer) - The status code of the response. - **data** (object) - The expense object containing details such as ID, number, transaction date, total amount, type, status, currency, company ID, memo, account, tracking categories, line items, created at, and updated at. #### Response Example ```json { "status_code": 200, "data": { "id": "a10dee2ca7258147170cb396fe154022", "number": "10783", "transaction_date": "2025-01-15T00:00:00Z", "total_amount": 700.00, "type": "expense", "status": "posted", "currency": "USD", "company_id": "Global_Modern_Services_Inc_USA", "memo": "Travel expenses", "account": { "id": "eyJBY2NvdW50X0lkIjoiMTAwMCIsIkFjY291bnRfU2V0X0lkIjoiQ29ycG9yYXRlIn0=" }, "tracking_categories": [ { "parent_id": "Cost_Center_Reference_ID", "id": "40000_Sales_Department" } ], "line_items": [ { "total_amount": 450.00, "unit_price": 450.00, "ledger_account": { "id": "eyJBY2NvdW50X0lkIjoiNjEwMCIsIkFjY291bnRfU2V0X0lkIjoiQ29ycG9yYXRlIn0=" }, "tracking_categories": [...] }, { "total_amount": 250.00, "unit_price": 250.00, "ledger_account": { "id": "eyJBY2NvdW50X0lkIjoiNjExMCIsIkFjY291bnRfU2V0X0lkIjoiQ29ycG9yYXRlIn0=" }, "tracking_categories": [...] } ], "created_at": "2025-01-15T14:23:10Z", "updated_at": "2025-01-15T14:23:10Z" } } ``` ``` -------------------------------- ### Initialize Apideck Client and List Contacts (Python) Source: https://developers.apideck.com/sdks/python Demonstrates how to initialize the Apideck client in Python using an API key, consumer ID, and app ID. It then shows an example of listing contacts with filtering, sorting, and passthrough parameters, and how to handle paginated results. ```python import apideck_unify from apideck_unify import Apideck import os with Apideck( api_key=os.getenv("APIDECK_API_KEY", ""), consumer_id="", app_id="", ) as apideck: res = apideck.crm.contacts.list(service_id="salesforce", filter_={ "first_name": "Elon", "last_name": "Musk", "email": "elon@tesla.com", "company_id": "12345", "owner_id": "12345", }, sort={ "by": apideck_unify.ContactsSortBy.CREATED_AT, "direction": apideck_unify.SortDirection.DESC, }, pass_through={ "search": "San Francisco", }, fields="id,updated_at") while res is not None: # Handle items res = res.next() ``` -------------------------------- ### Initialize Apideck CSharp SDK Source: https://developers.apideck.com/guides/sdk-migration-csharp Demonstrates the difference in SDK initialization between the old and new CSharp SDKs. The new SDK uses a unified configuration object for API key, consumer ID, and app ID. ```csharp // Old SDK Configuration config = new Configuration(); config.AddApiKey("Authorization", "API_KEY"); config.AddApiKeyPrefix("Authorization", "Bearer"); var apiInstance = new CrmApi(config); // New SDK var sdk = new Apideck( apiKey: "", consumerId: "test-consumer", appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" ); ``` -------------------------------- ### Get Connection Response Example Source: https://developers.apideck.com/guides/authorize-connections This JSON object represents a successful response from the Get Connections API call. It includes details about a specific service connection, such as its ID, name, authentication type, and importantly, the `authorize_url` and `revoke_url`. ```json { "status_code": 200, "status": "OK", "data": { "id": "crm+salesforce", "service_id": "salesforce", "name": "Salesforce", "tag_line": "CRM software solutions and enterprise cloud computing from Salesforce, the leader in customer relationship management (CRM) and PaaS. Free 30 day trial.", "unified_api": "crm", "state": "authorized", "auth_type": "oauth2", "oauth_grant_type": "authorization_code", "status": "live", "enabled": true, "website": "https://www.salesforce.com", "icon": "https://res.cloudinary.com/apideck/image/upload/v1529456047/catalog/salesforce/icon128x128.png", "logo": "https://c1.sfdcstatic.com/content/dam/web/en_us/www/images/home/logo-salesforce-m.svg", "authorize_url": "https://unify.apideck.com/vault/authorize/salesforce/?state=", "revoke_url": "https://unify.apideck.com/vault/revoke/salesforce/?state=", ... } } ``` -------------------------------- ### Install Apideck Components using npm Source: https://developers.apideck.com/components/button Installs the Apideck Components library using npm. This is the first step to using the components in your project. ```bash npm install @apideck/components ``` -------------------------------- ### Get All Ledger Accounts - API Request Source: https://developers.apideck.com/guides/journal-entries-expenses-ledger-accounts-workday This snippet shows the HTTP GET request to retrieve all ledger accounts from Workday. It requires an 'x-apideck-app-id' and 'x-apideck-service-id' header for authentication and service identification. ```http GET /accounting/ledger-accounts x-apideck-app-id: your-app-id x-apideck-service-id: workday ``` -------------------------------- ### Get One Ledger Account Source: https://developers.apideck.com/guides/journal-entries-expenses-ledger-accounts-workday Retrieves a specific account by its encoded ID. ```APIDOC ## GET /accounting/ledger-accounts/{id} ### Description Retrieves a specific ledger account by its encoded ID. ### Method GET ### Endpoint /accounting/ledger-accounts/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The base64-encoded ID of the ledger account. #### Query Parameters - **x-apideck-service-id** (string) - Required - The service ID for Workday. ### Request Example ```apidoc GET /accounting/ledger-accounts/eyJBY2NvdW50X0lkIjoiNjQwMCIsIkFjY291bnRfU2V0X0lkIjoiQ29ycG9yYXRlIn0= x-apideck-service-id: workday ``` ### Response #### Success Response (200) - **id** (string) - Base64-encoded JSON containing `Account_Id` and `Account_Set_Id`. - **display_id** (string) - Human-readable ledger account account number. - **classification** (string) - High-level type (`asset`, `liability`, `equity`, `revenue`, `expense`). - **name** (string) - The name of the ledger account. - **active** (boolean) - Whether the account is active. - **status** (string) - Account status (`active`, `inactive`). - **parent_account** (object) - Parent account details in the hierarchy. #### Response Example ```json { "status_code": 200, "data": { "id": "eyJBY2NvdW50X0lkIjoiNjQwMCIsIkFjY291bnRfU2V0X0lkIjoiQ29ycG9yYXRlIn0=", "display_id": "6400", "classification": "expense", "name": "Professional Fees", "active": true, "status": "active", "parent_account": { "id": "eyJBY2NvdW50X0lkIjoiNjAwMCIsIkFjY291bnRfU2V0X0lkIjoiQ29ycG9yYXRlIn0=", "name": "Operating Expenses" } } } ``` ``` -------------------------------- ### Initialize Apideck Client and Fetch CRM Contacts (.NET) Source: https://developers.apideck.com/sdks/dot-net Demonstrates how to initialize the Apideck client with API credentials and make a request to fetch CRM contacts. It includes setting up request parameters for filtering, sorting, and passing through additional data. The example also shows how to handle paginated results. ```csharp using ApideckUnifySdk; using ApideckUnifySdk.Models.Components; using ApideckUnifySdk.Models.Requests; using System.Collections.Generic; var sdk = new Apideck( apiKey: "", consumerId: "", appId: "" ); CrmContactsAllRequest req = new CrmContactsAllRequest() { ServiceId = "salesforce", Filter = new ContactsFilter() { FirstName = "Elon", LastName = "Musk", Email = "elon@tesla.com", CompanyId = "12345", OwnerId = "12345", }, Sort = new ContactsSort() { By = ContactsSortBy.CreatedAt, Direction = SortDirection.Desc, }, PassThrough = new Dictionary() { { "search", "San Francisco" }, }, Fields = "id,updated_at", }; CrmContactsAllResponse? res = await sdk.Crm.Contacts.ListAsync(req); while(res != null) { // handle items res = await res.Next!(); } ``` -------------------------------- ### Import Apideck SDK in Typescript Source: https://developers.apideck.com/guides/sdk-migration Demonstrates how to import the Apideck SDK after installation. This replaces the old import method. ```typescript import { Apideck } from '@apideck/unify' ```