Please follow the instructions below to use the Salesforce OneCRM GraphQL API.
Use the Subscription Key in your request headers:
ocp-apim-subscription-key: your_subscription_key
Generate an OAuth 2.0 Bearer Token using the following endpoint:
Method: POST
Body (x-www-form-urlencoded)
grant_type=client_credentials client_id=your_client_id client_secret=your_client_secret scope=api://a2e8b53a-8d19-4841-a59a-4671ca3fdf49/.default
Required Headers
Authorization: Bearer your_access_token ocp-apim-subscription-key: your_subscription_key Content-Type: application/json
query {
account(id: "001XX000003ABC") {
id
name
industry
}
}
query {
customer(id: "12345") {
name
email
phone
}
}
query Uiapi {
uiapi {
query {
Contact(first: 10) {
totalCount
pageResultCount
edges {
cursor
node {
Id
ApiName
WeakEtag
DisplayValue
}
}
}
}
}
}