SAP Knowledge Base Article - Public

3417551 - Using Upload Document API in Quote 1.0

Symptom

Customer wants to upload a document through Stateful API UploadDocument in Quote 1.0 environment.

Environment

SAP SALES CLOUD CPQ

Resolution

  • Cart/UploadCartAttachment API is intended to be used only through UI, it is not recommended to use it through external services
  • There are currently 2 ways to use endpoint to perform the document upload
    1. Getting Cookies from CPQ Session in the Browser:
      1. Upload attachment using UI in order to get CPQ Cookies
      2.  Add Cookie in postman request
      3. Upload file in the body of the request
      4. Call POST https://{{host}}/Cart/UploadCartAttachment
    2. Using Postman or other external system without requiring to use UI first:  
      1.  Stateful Authentication - https://{{host}}/api/rd/v1/Core/LogIn?username={{username}}&password={{password}}&domain={{domain}}
      2. Initialize Quote in Session - https://{{host}}/api/rd/v1/Cart/GetInitData?cartId={{cartId}}&ownerId={{ownerId}}&mode=0
      3. Upload File - https://{{host}}/Cart/UploadCartAttachment
  • As of CPQ-2405 an additional Cookie is required in order to API properly work, RequestVerificationToken, as can be seen in the request when using Network tools to understand how the API work (For more information, refer to See Also section of this Article)
    • Go to a Quote
    • Go to Document Tab
    • Open Browser Network Tools
    • Upload a document
    • Check cookies being sent in the request of the Cart/UploadCartAttachment.

See Also

As of 2405: Validation of CSRF Token | SAP Help Portal

Keywords

Upload, File, Document, Postman, API, Quote 1.0, CPQ , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , How To

Product

SAP CPQ 2023