API by router
Connections
Fetch Connection Credentials
Runtime fetches connection credentials. Auth: Bearer proxy key.
Verifies:
- Instance proxy-key auth
- Connection grant exists for this instance
- If capability specified, grant includes that capability
- Decrypts and returns credentials
Returns { "credentials": {...}, "capabilities": [...] }
Path Parameters
instance_idInstance Id
Format
uuidQuery Parameters
providerProvider
name?Name
capability?Capability
Required capability (e.g. send_mail). If specified, 403 if grant doesn't include it.
Response Body
curl -X GET "https://loading/internal/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections?provider=string&name=string&capability=string"{}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}List Connections
AuthorizationBearer <token>
In: header
Path Parameters
customer_idCustomer Id
Format
uuidHeader Parameters
X-Api-Key?X-Api-Key
Response Body
curl -X GET "https://loading/v1/customers/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections" \ -H "X-Api-Key: string"{
"connections": [
{
"auth_type": "string",
"created_at": "2019-08-24T14:15:22Z",
"customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
"error_message": "string",
"expires_at": "2019-08-24T14:15:22Z",
"grants": [],
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"last_used_at": "2019-08-24T14:15:22Z",
"name": "string",
"provider": "string",
"scopes": [
null
],
"status": "string",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"total": 0
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Create Connection
AuthorizationBearer <token>
In: header
Path Parameters
customer_idCustomer Id
Format
uuidHeader Parameters
X-Api-Key?X-Api-Key
auth_type?Auth Type
One of: ('oauth2', 'api_key', 'basic')
Default
"oauth2"credentialsCredentials
Provider credentials (stored encrypted)
Empty Object
metadata_json?Metadata Json
nameName
admin@iqm.com.au, IQM Master Roster, etc.
Length
length <= 255providerProvider
gmail, xero, google_calendar, deputy, etc.
Length
length <= 50scopes?Scopes
Response Body
curl -X POST "https://loading/v1/customers/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections" \ -H "X-Api-Key: string" \ -H "Content-Type: application/json" \ -d '{ "credentials": {}, "name": "string", "provider": "string" }'{
"auth_type": "string",
"created_at": "2019-08-24T14:15:22Z",
"customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
"error_message": "string",
"expires_at": "2019-08-24T14:15:22Z",
"grants": [],
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"last_used_at": "2019-08-24T14:15:22Z",
"name": "string",
"provider": "string",
"scopes": [
null
],
"status": "string",
"updated_at": "2019-08-24T14:15:22Z"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Delete Connection
AuthorizationBearer <token>
In: header
Path Parameters
customer_idCustomer Id
Format
uuidconnection_idConnection Id
Format
uuidHeader Parameters
X-Api-Key?X-Api-Key
Response Body
curl -X DELETE "https://loading/v1/customers/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "X-Api-Key: string"Empty
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Create Grant
AuthorizationBearer <token>
In: header
Path Parameters
customer_idCustomer Id
Format
uuidconnection_idConnection Id
Format
uuidHeader Parameters
X-Api-Key?X-Api-Key
capabilitiesCapabilities
Provider-specific capabilities (e.g. send_mail, read_events)
instance_idInstance Id
Format
uuidResponse Body
curl -X POST "https://loading/v1/customers/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08/grants" \ -H "X-Api-Key: string" \ -H "Content-Type: application/json" \ -d '{ "capabilities": [ "string" ], "instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366" }'{
"capabilities": [],
"connection_id": "d3547de1-d1f2-4344-b4c2-17169b7526f9",
"granted_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Delete Grant
AuthorizationBearer <token>
In: header
Path Parameters
customer_idCustomer Id
Format
uuidconnection_idConnection Id
Format
uuidgrant_idGrant Id
Format
uuidHeader Parameters
X-Api-Key?X-Api-Key
Response Body
curl -X DELETE "https://loading/v1/customers/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08/grants/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "X-Api-Key: string"Empty
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}