Call the Global Profile Lookup API
Quick example of how to call the Global Profile Lookup API.
To call the API, you must have already completed the other tasks in the Quick Start.
| User Permissions Needed | |
|---|---|
| To use the Developer Console: | API Enabled AND View All Data |
| To view, retain, and delete debug logs: | View All Data |
| To execute anonymous Apex: | Author Apex |
| To use code search and run SOQL or SOSL on the query tab: | API Enabled |
| To save changes to Apex classes and triggers: | Author Apex |
| To save changes to Visualforce pages and components: | Customize Application |
| To save changes to Lightning resources: | Customize Application |
| To access the Customer 360 Data Manager org | System Administrator |
You can use any tool of your choice to call the API. The code examples in this guide use a command-line tool called cURL to simplify sending and receiving HTTP requests and responses.
cURL is pre-installed on many Linux and Mac systems. Windows users can download a version at curl.haxx.se/. When using HTTPS on Windows, ensure that your system meets the cURL requirements for SSL.
The Base URI includes the API Gateway FQDN and the product domain. The API Gateway FQDN
depends on the region of the Customer 360 Data Manager.
| Region | Base URI |
|---|---|
| North America | na.api-salesforce.com |
| Europe | eu.api-salesforce.com |
| Asia/Pacific | ap.api-salesforce.com |
The required domain for the Global Profile Lookup API is datamanager.
Example: URL for the Jobs Resource
1https://na.api-salesforce.com/datamanager/datatools/v0.1/jobs- Open your command line.
-
To retrieve an access token, make an authentication call. Use the Customer 360 Data Manager
org name as the instance_url. If you are developing an app, the connected
app provides this access token, this call is only necessary for the examples that use
cURL.
- login_url: use the URL you use to log in to Salesforce.
- client_id: use the connected app consumer key.
- client_secret: use the connected app consumer secret.
- username: use the username you use to log in to Salesforce.
- password: use the password you use to log in to Salesforce.
1curl -k https://instance_url.salesforce.com/services/oauth2/token \ 2-d "grant_type=password" \ 3-d "client_id= 3MVG9qKMKuRGRcbuZ90BMXK_bF3MizRStXIw1gC7iPmpDmw5ScBvbCyZXJ7R2urNDRcwB3I7m9pt9qgd5ogMN" \ 4-d "client_secret= F490545988E166F17B0A7317068FB2ED71E913FBF0C1F24A732E8BB9FC82ACED" \ 5-d "username=admin@myapps.com" \ 6-d "password=test4mB1riuD3n"This result is an example:1{ 2 "access_token": "00DRM000000IeI2!AR4AQIJeeDdSm1eibRjSGn_qe4XOFG4_MUrRAo2RhA9WXWsQtWzRTxaAOdpwUYj7L21hqvI6lknfHc5Ua4Drf.GudSR82UXN", 3 "instance_url": "https://shadow-hnd-20.my.salesforce.com", 4 "id": "https://login.stmfb.stm.salesforce.com/id/00DRM000000IeI22AK/005RM000001yVhvYAE", 5 "token_type": "Bearer", 6 "issued_at": "1594662156814", 7 "signature": "Xik2Lq7n/1+F1S+aHF8kS7AeNQaQdLkRPG1pvsSP+8U=" 8} -
Use one of the resources of the API. You need information for the headers, URI parameters,
and authentication token. The x-sfdc-domain header value
is derived from the instance_url returned in the authentication token.
1curl -X POST \ 2https://na.api-salesforce.com/datamanager/profile-service/v0.1/globalProfile/search \ 3-H 'Authorization: Bearer 00DS7000000XYJR!AQoAQCoryJToeNGrzqJQ0yAt3liKf0zWzn01z1WrTUXDmULWQ9ah818vHbcMvMOwTPoMm5pJgRLVT1BEQhPeC9P8Xiif.vVv' \ 4-H 'Content-Type: application/json' \ 5-H 'X-Sfdc-domain: dmorg.salesforce.com' \ 6-d '{ 7"q": "emailaddress:profile_002@gmail.com" 8}'