You need to sign in to do that
Don't have an account?
Taro Uraoka
How to escape merge fields of Named Credentials?
I'm using Named Credentials with "Allow Merge Fields in HTTP Body" in Apex code.
How to include exact char sequence "{!$Credential.OAuthToken}" (avoid replaceing into OAuth token) into my request body?
How to include exact char sequence "{!$Credential.OAuthToken}" (avoid replaceing into OAuth token) into my request body?
Could you please share your code. That will help me in understanding the issue and sharing a resolution for it.
Thanks
Shashikant
For example, this batch posts Yesterday's Leads to another Salesforce organization using SOAP API and Named Credentials. SOAP API require sessionId in HTTP body. So I need "Allow Merge Fields in HTTP Body" in Named Credentials.
But If any Yesterday's Leads have Company field value: "{!$Credential.OAuthToken}",
the Company field value of the Lead record created in another organization is the OAuth token.
I want to create Lead record with Company field value: "{!$Credential.OAuthToken}".
Thanks
But endpoint is not only Salesforce platform.
Sometimes I need post plain text. So I want to know how to escape merge fields syntax like "{!$Credential.OAuthToken}".
Thanks