Telephony Integration REST API Authorization
While creating a contact center instance with the Service Cloud Voice setup flow, a private/public key pair is auto-generated. The private key is stored as a secure string in AWS Systems Manager Parameter Store. The private key can be a 1024-, 2048, or 4096-bit RSA key length. We recommend an RSA key length of 2048.
The public key is stored in the corresponding Salesforce CallCenter record. The private key is used to sign the JWT claim which must be included in the Bearer header for any HTTP request targeting the Service Cloud Voice REST API.
The following prerequisites must be satisfied before you can start the authorization process flow.
Once you’ve satisfied these prerequisites, set up authorization for this API.
- Construct a JWT header with this format: {"alg":"RS256"}.
- Base64url encode the JWT header as defined in Base 64 Encoding with URL and Filename Safe Alphabet. For example: eyJhbGciOiJSUzI1NiJ9.
-
Construct a JSON claims set for the JWT with the following parameters:
- iss—The issuer is the Salesforce org ID where you set up your contact center and registered the certificate.
- sub—The subject must contain the “Salesforce Call Center API Name”.
- aud—The audience identifies the authorization server as an intended audience. The authorization server must verify that it is an intended audience for the token. Use https://scrt.salesforce.com.
- exp—The expiration time of the assertion within 3 minutes, expressed as the number of seconds from 1970-01-01T0:0:0Z measured in UTC.
- jwtId—The unique ID for the JWT token.
Sample JSON claim set for the JWT:
{ "iss": "00DRM000000GuTE", "sub": "HVCC", "aud": "https://scrt.salesforce.com", "exp": 1333685628 }
- Base64url encode the JWT claims set without any line breaks.
- Retrieve the private key stored in the keystore.
- Sign the payload using the private key to generate JWT token.
- Use the generated JWT token as part of the Authorization header when making the API request.