Skip to content

Latest commit

 

History

History
1540 lines (1076 loc) · 35.3 KB

VaultApi.md

File metadata and controls

1540 lines (1076 loc) · 35.3 KB

Apideck.Vault

Class Name

VaultApi

Methods

List Connection Custom Mappings

Method: connectionCustomMappingsAll

vaultApi.connectionCustomMappingsAll(body)

Parameters

Name Type Description Notes
unifiedApi [string] Unified API
serviceId [string] Service ID of the resource to return
resource [string] Name of the resource (plural)
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
resourceId [string] This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. (optional)

Response Type

GetCustomMappingsResponse

HTTP response details

Status code Description
200 Custom mapping
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  unifiedApi: 'crm',
  serviceId: 'pipedrive',
  resource: 'leads'
}

try {
  const { data } = await apideck.vault.connectionCustomMappingsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Resource Settings

Method: connectionSettingsAll

vaultApi.connectionSettingsAll(body)

Parameters

Name Type Description Notes
unifiedApi [string] Unified API
serviceId [string] Service ID of the resource to return
resource [string] Name of the resource (plural)
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)

Response Type

GetConnectionResponse

HTTP response details

Status code Description
200 Connection
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  unifiedApi: 'crm',
  serviceId: 'pipedrive',
  resource: 'leads'
}

try {
  const { data } = await apideck.vault.connectionSettingsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Settings

Method: connectionSettingsUpdate

vaultApi.connectionSettingsUpdate(body)

Parameters

Name Type Description Notes
connection Connection Fields that need to be updated on the resource
serviceId [string] Service ID of the resource to return
unifiedApi [string] Unified API
resource [string] Name of the resource (plural)
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)

Response Type

UpdateConnectionResponse

HTTP response details

Status code Description
200 Connection updated
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  serviceId: 'pipedrive',
  unifiedApi: 'crm',
  resource: 'leads',
  connection: {
    enabled: true,
    settings: {
      instance_url: 'https://eu28.salesforce.com',
      api_key: '12345xxxxxx'
    },
    metadata: {
      account: {
        name: 'My Company',
        id: 'c01458a5-7276-41ce-bc19-639906b0450a'
      },
      plan: 'enterprise'
    },
    configuration: [
      {
        resource: 'leads',
        defaults: [
          {
            id: 'ProductInterest',
            options: [Array],
            value: 'GC5000 series'
          }
        ]
      }
    ],
    custom_mappings: [
      {
        value: '$.root.training.first_aid'
      }
    ]
  }
}

try {
  const { data } = await apideck.vault.connectionSettingsUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get All Connections

Method: connectionsAll

vaultApi.connectionsAll(body)

Parameters

Name Type Description Notes
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
api [string] Scope results to Unified API (optional)
configured [boolean] Scopes results to connections that have been configured or not (optional)

Response Type

GetConnectionsResponse

HTTP response details

Status code Description
200 Connections
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.vault.connectionsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Deletes A Connection

Method: connectionsDelete

vaultApi.connectionsDelete(body)

Parameters

Name Type Description Notes
serviceId [string] Service ID of the resource to return
unifiedApi [string] Unified API
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)

Response Type

void (empty response body)

HTTP response details

Status code Description
204 Resource deleted
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  serviceId: 'pipedrive',
  unifiedApi: 'crm'
}

try {
  const { data } = await apideck.vault.connectionsDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Import Connection

Method: connectionsImport

vaultApi.connectionsImport(body)

Parameters

Name Type Description Notes
connection ConnectionImportData Fields that need to be persisted on the resource
serviceId [string] Service ID of the resource to return
unifiedApi [string] Unified API
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)

Response Type

CreateConnectionResponse

HTTP response details

Status code Description
200 Connection created
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  serviceId: 'pipedrive',
  unifiedApi: 'crm',
  connection: {
    credentials: {
      access_token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',
      refresh_token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.cThIIoDvwdueQB468K5xDc5633seEFoqwxjF_xSJyQQ'
    },
    settings: {
      instance_url: 'https://eu28.salesforce.com'
    },
    metadata: {
      account: {
        name: 'My Company',
        id: 'c01458a5-7276-41ce-bc19-639906b0450a'
      },
      plan: 'enterprise'
    }
  }
}

try {
  const { data } = await apideck.vault.connectionsImport(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Connection

Method: connectionsOne

vaultApi.connectionsOne(body)

Parameters

Name Type Description Notes
serviceId [string] Service ID of the resource to return
unifiedApi [string] Unified API
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)

Response Type

GetConnectionResponse

HTTP response details

Status code Description
200 Connection
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  serviceId: 'pipedrive',
  unifiedApi: 'crm'
}

try {
  const { data } = await apideck.vault.connectionsOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Authorize Access Token

Method: connectionsToken

vaultApi.connectionsToken(body)

Parameters

Name Type Description Notes
body object
serviceId [string] Service ID of the resource to return
unifiedApi [string] Unified API
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)

Response Type

GetConnectionResponse

HTTP response details

Status code Description
200 Connection
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  serviceId: 'pipedrive',
  unifiedApi: 'crm',
  connectionsToken: {}
}

try {
  const { data } = await apideck.vault.connectionsToken(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Connection

Method: connectionsUpdate

vaultApi.connectionsUpdate(body)

Parameters

Name Type Description Notes
connection Connection Fields that need to be updated on the resource
serviceId [string] Service ID of the resource to return
unifiedApi [string] Unified API
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)

Response Type

UpdateConnectionResponse

HTTP response details

Status code Description
200 Connection updated
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  serviceId: 'pipedrive',
  unifiedApi: 'crm',
  connection: {
    enabled: true,
    settings: {
      instance_url: 'https://eu28.salesforce.com',
      api_key: '12345xxxxxx'
    },
    metadata: {
      account: {
        name: 'My Company',
        id: 'c01458a5-7276-41ce-bc19-639906b0450a'
      },
      plan: 'enterprise'
    },
    configuration: [
      {
        resource: 'leads',
        defaults: [
          {
            id: 'ProductInterest',
            options: [Array],
            value: 'GC5000 series'
          }
        ]
      }
    ],
    custom_mappings: [
      {
        value: '$.root.training.first_aid'
      }
    ]
  }
}

try {
  const { data } = await apideck.vault.connectionsUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Consumer Request Counts

Method: consumerRequestCountsAll

vaultApi.consumerRequestCountsAll(body)

Parameters

Name Type Description Notes
consumerId [string] ID of the consumer to return
startDatetime [string] Scopes results to requests that happened after datetime
endDatetime [string] Scopes results to requests that happened before datetime
appId [string] The ID of your Unify application (optional)

Response Type

ConsumerRequestCountsInDateRangeResponse

HTTP response details

Status code Description
200 Consumers Request Counts within Date Range
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID'
});

const params = {
  consumerId: 'test_user_id',
  startDatetime: '2021-05-01T12:00:00.000Z',
  endDatetime: '2021-05-30T12:00:00.000Z'
}

try {
  const { data } = await apideck.vault.consumerRequestCountsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Consumer

Method: consumersAdd

vaultApi.consumersAdd(body)

Parameters

Name Type Description Notes
consumer Consumer
appId [string] The ID of your Unify application (optional)

Response Type

CreateConsumerResponse

HTTP response details

Status code Description
200 Consumer created
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID'
});

const params = {
  consumer: {
    consumer_id: 'test_consumer_id',
    metadata: {
      account_name: 'SpaceX',
      user_name: 'Elon Musk',
      email: '[email protected]',
      image: 'https://www.spacex.com/static/images/share.jpg'
    }
  }
}

try {
  const { data } = await apideck.vault.consumersAdd(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get All Consumers

Method: consumersAll

vaultApi.consumersAll(body)

Parameters

Name Type Description Notes
appId [string] The ID of your Unify application (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20

Response Type

GetConsumersResponse

HTTP response details

Status code Description
200 Consumers
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID'
});

const params = {}

try {
  const { data } = await apideck.vault.consumersAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Delete Consumer

Method: consumersDelete

vaultApi.consumersDelete(body)

Parameters

Name Type Description Notes
consumerId [string] ID of the consumer to return
appId [string] The ID of your Unify application (optional)

Response Type

DeleteConsumerResponse

HTTP response details

Status code Description
200 Consumer deleted
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID'
});

const params = {
  consumerId: 'test_user_id'
}

try {
  const { data } = await apideck.vault.consumersDelete(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Consumer

Method: consumersOne

vaultApi.consumersOne(body)

Parameters

Name Type Description Notes
consumerId [string] ID of the consumer to return
appId [string] The ID of your Unify application (optional)

Response Type

GetConsumerResponse

HTTP response details

Status code Description
200 Consumer
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID'
});

const params = {
  consumerId: 'test_user_id'
}

try {
  const { data } = await apideck.vault.consumersOne(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Update Consumer

Method: consumersUpdate

vaultApi.consumersUpdate(body)

Parameters

Name Type Description Notes
consumer UpdateConsumerRequest
consumerId [string] ID of the consumer to return
appId [string] The ID of your Unify application (optional)

Response Type

UpdateConsumerResponse

HTTP response details

Status code Description
200 Consumer updated
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID'
});

const params = {
  consumerId: 'test_user_id',
  consumer: {
    metadata: {
      account_name: 'SpaceX',
      user_name: 'Elon Musk',
      email: '[email protected]',
      image: 'https://www.spacex.com/static/images/share.jpg'
    }
  }
}

try {
  const { data } = await apideck.vault.consumersUpdate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get Resource Custom Fields

Method: customFieldsAll

vaultApi.customFieldsAll(body)

Parameters

Name Type Description Notes
unifiedApi [string] Unified API
serviceId [string] Service ID of the resource to return
resource [string] Name of the resource (plural)
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)
resourceId [string] This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. (optional)

Response Type

GetCustomFieldsResponse

HTTP response details

Status code Description
200 Custom mapping
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  unifiedApi: 'crm',
  serviceId: 'pipedrive',
  resource: 'leads'
}

try {
  const { data } = await apideck.vault.customFieldsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

List Custom Mappings

Method: customMappingsAll

vaultApi.customMappingsAll(body)

Parameters

Name Type Description Notes
unifiedApi [string] Unified API
serviceId [string] Service ID of the resource to return
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)

Response Type

GetCustomMappingsResponse

HTTP response details

Status code Description
200 Custom mapping
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  unifiedApi: 'crm',
  serviceId: 'pipedrive'
}

try {
  const { data } = await apideck.vault.customMappingsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Get All Consumer Request Logs

Method: logsAll

vaultApi.logsAll(body)

Parameters

Name Type Description Notes
appId [string] The ID of your Unify application (optional)
consumerId [string] ID of the consumer which you want to get or push data from (optional)
filter LogsFilter Filter results (optional)
cursor [string] Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. (optional)
limit [number] Number of results to return. Minimum 1, Maximum 200, Default 20 (optional) defaults to 20

Response Type

GetLogsResponse

HTTP response details

Status code Description
200 Logs
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {}

try {
  const { data } = await apideck.vault.logsAll(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Create Session

Method: sessionsCreate

vaultApi.sessionsCreate(body)

Parameters

Name Type Description Notes
session Session Additional redirect uri and/or consumer metadata
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)

Response Type

CreateSessionResponse

HTTP response details

Status code Description
200 Session created
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  session: {
    consumer_metadata: {
      account_name: 'SpaceX',
      user_name: 'Elon Musk',
      email: '[email protected]',
      image: 'https://www.spacex.com/static/images/share.jpg'
    },
    redirect_uri: 'https://mysaas.com/dashboard',
    settings: {
      unified_apis: [
        'crm'
      ],
      hide_resource_settings: false,
      sandbox_mode: false,
      isolation_mode: false,
      session_length: '30m',
      show_logs: true,
      show_suggestions: false,
      show_sidebar: true,
      auto_redirect: false,
      hide_guides: false,
      allow_actions: [
        'delete'
      ]
    },
    theme: {
      favicon: 'https://res.cloudinary.com/apideck/icons/intercom',
      logo: 'https://res.cloudinary.com/apideck/icons/intercom',
      primary_color: '#286efa',
      sidepanel_background_color: '#286efa',
      sidepanel_text_color: '#FFFFFF',
      vault_name: 'Intercom',
      privacy_url: 'https://compliance.apideck.com/privacy-policy',
      terms_url: 'https://www.termsfeed.com/terms-conditions/957c85c1b089ae9e3219c83eff65377e'
    },
    custom_consumer_settings: {
      feature_flag_1: true,
      tax_rates: [
        {
          id: '6',
          label: '6%'
        },
        {
          id: '21',
          label: '21%'
        }
      ]
    }
  }
}

try {
  const { data } = await apideck.vault.sessionsCreate(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]

Validate Connection State

Method: validateConnectionState

vaultApi.validateConnectionState(body)

Parameters

Name Type Description Notes
body object
serviceId [string] Service ID of the resource to return
unifiedApi [string] Unified API
consumerId [string] ID of the consumer which you want to get or push data from (optional)
appId [string] The ID of your Unify application (optional)

Response Type

ValidateConnectionStateResponse

HTTP response details

Status code Description
200 Connection access token refreshed
400 Bad Request
401 Unauthorized
402 Payment Required
404 The specified resource was not found
422 Unprocessable
4/5xx Unexpected error

Example Usage

import { Apideck } from '@apideck/node';

const apideck = new Apideck({
  apiKey: 'REPLACE_WITH_API_KEY',
  appId: 'REPLACE_WITH_APP_ID',
  consumerId: 'REPLACE_WITH_CONSUMER_ID'
});

const params = {
  serviceId: 'pipedrive',
  unifiedApi: 'crm',
  validateConnectionState: {}
}

try {
  const { data } = await apideck.vault.validateConnectionState(params)
  console.log('API called successfully', data)
} catch (error) {
  console.error(error)
  return error.json()
}

[Back to top] [Back to API list] [Back to README]