Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): /connections/:connectionId New Format #3200

Merged
merged 5 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 1 addition & 35 deletions docs-v2/reference/api/connection/get.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,9 @@ title: 'Get connection & credentials'
openapi: 'GET /connection/{connectionId}'
---

<ResponseExample>
```json Example Response
{
"id": 18393, // Nango internal connection id
"created_at": "2023-03-08T09:43:03.725Z", // Creation timestamp
"updated_at": "2023-03-08T09:43:03.725Z", // Last updated timestamp (e.g. last token refresh)
"provider_config_key": "github", // <INTEGRATION-ID>
"connection_id": "1", // <CONNECTION-ID>
"credentials": {
"type": "OAUTH2", // OAUTH2 or OAUTH1
"access_token": "gho_tsXLG73f....", // The current access token (refreshed if needed)
"refresh_token": "gho_fjofu84u9....", // Refresh token (Only returned if the REFRESH_TOKEN boolean parameter is set to true and the refresh token is available)
"expires_at": "2024-03-08T09:43:03.725Z", // Expiration date of access token (only if refresh token is present, otherwise missing)
"raw": { // Raw token response from the OAuth provider: Contents vary!
"access_token": "gho_tsXLG73f....",
"refresh_token": "gho_fjofu84u9....", // Refresh token (Only returned if the REFRESH_TOKEN boolean parameter is set to true and the refresh token is available)
"token_type": "bearer",
"scope": "public_repo,user"
}
},
"connection_config": { // Additional API Configuration, see OAuth guide
"subdomain": "myshop",
"realmId": "XXXXX",
"instance_id": "YYYYYYY"
},
"account_id": 0, // ID of your Nango account (Nango Cloud only)
"metadata": { // Custom metadata stored by you
"myProperty": "yes",
"filter": "closed=true"
}
}
```
</ResponseExample>

<Info>

The response content depends on the API authentication type (OAuth 2, OAuth 1, API key, Basic auth).
The response content depends on the API authentication type (e.g: OAuth 2, OAuth 1, API key, etc.).

If you do not want to deal with collecting & injecting credentials in requests for multiple authentication types, use the Proxy([step-by-step guide](/guides/proxy-requests-to-an-api)).

Expand Down
9 changes: 4 additions & 5 deletions docs-v2/reference/sdks/node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ We recommend not caching tokens for longer than 5 minutes to ensure they are fre
"realmId": "XXXXX",
"instance_id": "YYYYYYY"
},
"account_id": 0,
"metadata": {
"myProperty": "yes",
"filter": "closed=true"
Expand Down Expand Up @@ -939,7 +938,7 @@ await nango.startSync('<INTEGRATION-ID>', ['SYNC_NAME1', 'SYNC_NAME2'], '<CONNEC
The name of the syncs that should be triggered.
</ResponseField>
<ResponseField name="connectionId" type="string">
The connection ID. If ommitted, the sync will trigger for all relevant connections.
The connection ID. If omitted, the sync will trigger for all relevant connections.
</ResponseField>
</Expandable>

Expand All @@ -965,7 +964,7 @@ await nango.startSync('<INTEGRATION-ID>', ['SYNC_NAME1', 'SYNC_NAME2'], '<CONNEC
The name of the syncs that should be paused.
</ResponseField>
<ResponseField name="connectionId" type="string">
The connection ID. If ommitted, the sync will pause for all relevant connections.
The connection ID. If omitted, the sync will pause for all relevant connections.
</ResponseField>
</Expandable>

Expand Down Expand Up @@ -1108,7 +1107,7 @@ await nango.triggerAction('<INTEGRATION-ID>', '<CONNECTION_ID>', '<ACTION-NAME>'
<ResponseField name="actionName" type="string" required>
The name of the action to trigger.
</ResponseField>
<ResponseField name="input" type="unkown" required>
<ResponseField name="input" type="unknown" required>
The necessary input for your action's `runAction` function.
</ResponseField>
</Expandable>
Expand Down Expand Up @@ -1171,7 +1170,7 @@ await nango.delete(config); // DELETE request
Array of additional status codes to retry a request in addition to the 5xx, 429, ECONNRESET, ETIMEDOUT, and ECONNABORTED
</ResponseField>
<ResponseField name="baseUrlOverride" type="string">
The API base URL. Can be ommitted if the base URL is configured for this API in the [providers.yaml](https://nango.dev/providers.yaml).
The API base URL. Can be omitted if the base URL is configured for this API in the [providers.yaml](https://nango.dev/providers.yaml).
</ResponseField>
<ResponseField name="decompress" type="boolean">
Override the decompress option when making requests. Optional, defaults to false
Expand Down
Loading
Loading