curl --request POST \
--url https://api.withampersand.com/v1/oauth-connect \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"projectIdOrName": "my-project",
"provider": "salesforce",
"groupRef": "group-123",
"consumerRef": "user_123456"
}
'"https://login.salesforce.com/services/oauth2/authorize?client_id=xxx&redirect_uri=https%3A%2F%2Fapi.withampersand.com%2Fcallbacks%2Fv1%2Foauth&state=xxx"{
"type": "about:blank",
"href": "https://www.belgif.be/specification/rest/api-guide/#standardized-problem-types",
"title": "Bad Request",
"status": 400,
"detail": "The input message is incorrect",
"instance": "123456-1234-1235-4567489798",
"issues": [
{
"type": "about:blank",
"detail": "exampleNumericProperty should be numeric",
"in": "path",
"name": "exampleNumericProperty",
"value": "abc"
},
{
"type": "about:blank",
"title": "Input isn't valid with respect to schema",
"detail": "examplePropertyWithPattern a2345678901 doesn't match pattern '^\\d{11}$'",
"in": "body",
"name": "items[0].examplePropertyWithPattern",
"value": "a2345678901"
}
]
}{
"type": "urn:problem-type:exampleOrganization:exampleProblem",
"href": "https://www.belgif.be/specification/rest/api-guide/#standardized-problem-types",
"title": "Description of the type of problem that occurred",
"status": 400,
"detail": "Description of specific occurrence of the problem",
"instance": "urn:uuid:123e4567-e89b-12d3-a456-426614174000"
}Generate OAuth authorization URL
Generate a URL for the browser to render to kick off OAuth flow. You can use this endpoint as an alternative to the prebuilt UI components.
curl --request POST \
--url https://api.withampersand.com/v1/oauth-connect \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"projectIdOrName": "my-project",
"provider": "salesforce",
"groupRef": "group-123",
"consumerRef": "user_123456"
}
'"https://login.salesforce.com/services/oauth2/authorize?client_id=xxx&redirect_uri=https%3A%2F%2Fapi.withampersand.com%2Fcallbacks%2Fv1%2Foauth&state=xxx"{
"type": "about:blank",
"href": "https://www.belgif.be/specification/rest/api-guide/#standardized-problem-types",
"title": "Bad Request",
"status": 400,
"detail": "The input message is incorrect",
"instance": "123456-1234-1235-4567489798",
"issues": [
{
"type": "about:blank",
"detail": "exampleNumericProperty should be numeric",
"in": "path",
"name": "exampleNumericProperty",
"value": "abc"
},
{
"type": "about:blank",
"title": "Input isn't valid with respect to schema",
"detail": "examplePropertyWithPattern a2345678901 doesn't match pattern '^\\d{11}$'",
"in": "body",
"name": "items[0].examplePropertyWithPattern",
"value": "a2345678901"
}
]
}{
"type": "urn:problem-type:exampleOrganization:exampleProblem",
"href": "https://www.belgif.be/specification/rest/api-guide/#standardized-problem-types",
"title": "Description of the type of problem that occurred",
"status": 400,
"detail": "Description of specific occurrence of the problem",
"instance": "urn:uuid:123e4567-e89b-12d3-a456-426614174000"
}Authorizations
Body
The Ampersand project ID or project name.
"my-project"
The provider that this app connects to.
"salesforce"
Your application's identifier for the organization or workspace that this connection belongs to (e.g. an org ID or team ID).
"group-123"
The ID that your app uses to identify the user whose SaaS credential will be used for this OAuth flow.
"user_123456"
The display name for the group. Defaults to groupRef if not provided.
"Organization Name"
The display name for the consumer. Defaults to consumerRef if not provided.
"John Doe"
The identifier for the provider workspace (e.g. the Salesforce subdomain).
"acme-corp"
Additional provider-specific metadata required by certain providers (e.g., account ID for NetSuite). See provider documentation for which fields are needed.
Show child attributes
Show child attributes
{
"accountId": { "value": "1234567890", "source": "input" }
}
ID of the provider app, returned from the Create Provider App endpoint. If omitted, the default provider app that was set up on the Ampersand Dashboard is assumed.
"32356abe-d2fd-49c7-9030-abdcbc6456d4"
This boolean flag is used by the UI library internally. Set it to false or omit it when manually calling this API.
false
Response
OK
URL to render
"https://login.salesforce.com/services/oauth2/authorize?client_id=xxx&redirect_uri=https%3A%2F%2Fapi.withampersand.com%2Fcallbacks%2Fv1%2Foauth&state=xxx"
Was this page helpful?

