Connect.registerUsers
From Facebook Developer Wiki
Contents |
Description
This method is used to create an association between an existing user account on your site and that user's Facebook account, provided the user has not connected accounts before.
This method takes an array of account data, including a required email_hash and optional account data. For each connected account, if the user exists, the information is added to the set of the user's connected accounts. If the user has already authorized the site, the connected account is added in the confirmed state. If the user has not yet authorized the site, the connected account is added in the pending state.
If the user deactivates their external user account, then call connect.unregisterUsers. To get the number of friends a user has in the pending state, use connect.getUnconnectedFriendsCount.
Parameters
| Required | Name | Type | Description | |
| required | api_key | string | The application key associated with the calling application. If you specify the API key in your client, you don't need to pass it with every call. | |
|---|---|---|---|---|
| sig | string | An MD5 hash of the current request and your secret key, as described in the How Facebook Authenticates Your Application. Facebook computes the signature for you automatically. | ||
| v | float | This must be set to 1.0 to use this version of the API. If you specify the version in your client, you don't need to pass it with every call. | ||
| accounts | array | An array of up to 1,000 arrays, or "maps," where each map represent a connected account. Each map can have the following properties:
account_id or the account_url properties. | ||
| optional | format | string | The desired response format, which can be either XML or JSON. (Default value is XML.) |
Response
This method returns an array of email hashes that have been successfully registered. If any email hashes are missing, we recommend that you try registering them again later.
Notes
- Registering accounts is idempotent (that is, performing the operation multiple times achieves the same result - it's not a toggle). If the user connects the two accounts, re-registering the account preserves that value.
- The typical use case for this method will be a bulk transfer of existing users with periodic updates for new users. We recommend that you transfer as many accounts as possible (up to the maximum of 1,000) in a single call for performance reasons.
- This method is typically used in conjunction with either users.getInfo or fql.query in order to associate external user accounts with Facebook user accounts. Once an email hash has been registered and confirmed by the user (which occurs when the user authorizes the site by logging into it or accepting a Connect request), it will be returned as part of the email_hashes property available via users.getInfo and fql.query.
