0

I am trying to use the Quote Generation API for Salesforce, I referred the below link for reference

https://developer.salesforce.com/docs/atlas.en-us.cpq_dev_api.meta/cpq_dev_api/cpq_api_generate_proposal.htm

I am using postman to trigger the below endpoint

URL :

https://ap16.salesforce.com/services/apexrest/SBQQ/ServiceRouter?saver=QuoteDocumentAPI.SaveProposal

Request Body :

{
    "saver": "SBQQ.QuoteDocumentAPI.Save",
    "model": "{\\\"name\\\":\\\"test\\\",\\\"quoteId\\\":\\\"a0n0R000000jhVC\\\",\\\"templateId\\\":\\\"a0l0R000000vahe\\\",\\\"outputFormat\\\":\\\"PDF\\\",\\\"language\\\":\\\"en_US\\\",\\\"paperSize\\\":\\\"Default\\\"}"
}

Response :

[
    {
        "message": "Unexpected parameter encountered during deserialization: saver at [line:1, column:11]",
        "errorCode": "JSON_PARSER_ERROR"
    }
]

As you can see the above sample request and response. I am getting Json Parser exception. Can anyone help me out here to figure out where i am going wrong?

1
  • Are you sure three \\\"name\\\":\\\"test\\\" three backward slash is reqd.
    – Ysr Shk
    Aug 19 '20 at 6:20
0

The correct message should be:

   {
      "saver": "SBQQ.QuoteDocumentAPI.Save",
      "model": {
        "name": "test",
        "quoteId": "a0n0R000000jhVC",
        "templateId": "a0l0R000000vahe",
        "outputFormat": "PDF",
        "language": "en_US",
        "paperSize": "Default"
      }
   }

You don't have to escape double quotes with backshlash when using Postman.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.