Connect a user's network account
https://api.knod.es/users/connect
Provide credentials for a user on a particular network. This is as close as the Knodes API comes to a register/login call. If a user already exists for the provided network identity, that user will be returned (updating the credentials if necessary).
Take caution with multi-network applications. If you want to add credentials for a new network to an existing user, you must be sure to pass that user's ID in the user_id parameter when connecting the additional account. If you do not, then a new Knodes user will be created for the new credentials.
Requirements
Acting Customer | Yes |
---|---|
Acting User | No |
HTTP Methods
If a method is not listed, it is not supported for this call
POST | Issue command |
---|
Parameters
Parameters optional unless specified
Name | Description | Required? |
---|---|---|
user_id |
ID of existing user to connect. If empty, will look for a user already connected to this network identity. If no such user exists, will create a new user. An error will be returned if you attempt to connect a network identity that has already been connected to a new user. You must first disconnect the identity from the original user. |
|
network | Network being connected. | Yes |
network_id | ID of the account being connected on network. | Yes |
token | Access token for user on network. This parameter is not required if this network identity has already been connected to a user for this customer via a prior call to users/connect. However, it is safer to always provide, as tokens can change. | |
secret | Some networks have two-part authentication credentials. If the network in question provided a secret in addition to a token, provide it here. | |
refresh_token | OAuth refresh token, if applicable (req'd for Google contacts). | |
created | OAuth timestamp when token was created, if any (req'd for Google contacts). | |
expires_in | OAuth expires time in seconds, if a non-expiring taken cannot be obtained (req'd for Google contacts). | |
do_index |
Non-empty value to request that this user be (re) indexed to
capture data from newly connected accounts.
If your application connects users to
multiple social networks, it is recommended you issue a specific call to
users/do_index after a user has connected all applicable accounts, rather
than use this flag, to avoid redundant indexing.
Note: if the user is already connected to the account being connected, the index request will be ignored. |
|
notifications.first_index_begin.template_id | Override the default notification template to use when this user first connects. Specify the ID of an existing notification template for this customer. | |
notifications.first_index_begin.context.<key> | Set a value of key in the notification's context, which will be passed to the template. One interesting context attribute to set is targetUrl, which is used to determine the default URL a notified user is directed to. | |
notifications.first_index_complete.template_id | Override the default notification template to use when this user completes indexing for the first time. Specify the ID of an existing notification template for this customer. | |
notifications.first_index_complete.q<n> | Specify queries to use to put contextual faces in the index complete notification. | |
notifications.first_index_complete.no_results_template_id | If providing a query for putting contextual faces in the index complete notification, can optionally specify a template to use when there are no results for the given queries. If no such template is specified, and there are no results to the contextual queries, then no notification will be sent. | |
notifications.first_index_complete.context.<key> | Set a value of key in the notification's context, which will be passed to the template. One interesting context attribute to set is targetUrl, which is used to determine the default URL a notified user is directed to. | |
notifications.<type>.disable | disable a notification. | |
notifications.<type>.url_callback | Provide a url callback for the notification |
Response
User object.