Create datasource in account

POST /accounts/{account_externalid}/datasources

Create a new datasource (connected application) in a customer account.

The required inputs of the connector (e.g. environment, API key etc.) have to be provided. Use Get connector to get the required and optional inputs of a connector.

If the connector uses oAuth, the user should be redirected to the link provided in the response. This link will start the oAuth authorization flow (for oAuth applications).

If the link is opened in a popup, the popup will close on a successful connection. When a redirect_url is provided, the user will be redirected to that redirect_url on a successful connection.

Fields in response:

  • link: the URL to which the user should be redirected to authorize access to the datasource (e.g. Salesforce or Hubspot) for connectors that use oAuth. This link is valid for 30 minutes.
  • is_used: true if the datasource is used in a Blend. Note: a datasource can be loosely coupled, this means it is is used in a Blend but not specifically set under the datasource settings of the blocks in a Blend. In this case is_used will be false.
  • is_connected: false if the datasource is not connected, e.g. after a failed oAuth flow.

Path Parameters

Name Description Type
account_externalid string

Body Parameters

Name Description Type Required
name string Yes
connector_guid Use List connectors to get the guid of a connector. string Yes
redirect_url Optional, only for oAuth connectors. string
params Required if connector has required input params. Use Get connector to retrieve the inputs of a connector. array_object

Examples

{
  "connector_guid": "0d86f238-27c0-11ea-921c-022e6b5ea1e2", 
  "name": "Salesforce connection",
  "params": {
    "environment": "production",
    "api_key" : "12345"
  }
}

Results

200

{
  "guid": "fe35b720-0d53-11eb-b488-6f85f7dcde48",
  "name": "My Datasource name",
  "connector": {
    "guid": "0d86df6c-27c0-11ea-921c-022e6b5ea1e2",
    "name": "Teamleader"
  },
  "is_used": false,
  "is_connected": false,
  "created_at": "2020-10-13T12:59:56.000000Z",
  "updated_at": "2020-10-13T12:59:56.000000Z",
  "additional": {
    "message": "This datasource requires user interaction to complete the setup.",
    "link": "https:\/\/admin.blendr.io\/datasources\/fe35b720-0d53-11eb-b488-6f85f7dcde48\/link?jwt=eyJ0eXAiOiJKV1QiL...dXJsIjpudWxsfQ.NzxuaD3W8fAPdkghzAeHpxmnf__ZDhfi_U9R7DscM1Q"
  }
}

400

{}