Newer Version Available
Step Three: Connect to Chatter REST API Using OAuth
Complete Step Two: Set Up Authorization and create a connected app before starting this task.
| Connected App Application Label | Value in Example |
|---|---|
| Consumer Key | client_id |
| Consumer Secret | client_secret |
To make a request to Salesforce, substitute values from your organization into these examples:
-
Generate the access token. This cURL command generates an access token:The response includes the server instance and the access token:
-
To request a Chatter REST API resource, use the returned instance_url as the server instance. Pass the returned access_token as a Bearer token in the Authorization request
header.
| Property | Value |
|---|---|
| client_id | 3MVG9PhR6g6B7ps4xDycwGrI4PvjVZvK9 |
| client_secret | 8870355475032095511 |
| grant_type | password The value of grant_type depends on the OAuth authentication flow you are using. Append the user’s security token to their password. A security token is an automatically generated key from Salesforce. For example, if a user's password is mypassword, and their security token is XXXXXXXXXX, then the value provided for this parameter must be mypasswordXXXXXXXXXX. |
| username | admin@seattleapps.com |
| password | test1234mB1riuD3n |