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
- Getting Cookies from CPQ Session in the Browser:
- Upload attachment using UI in order to get CPQ Cookies
- Add Cookie in postman request
- Upload file in the body of the request
- Call POST https://{{host}}/Cart/UploadCartAttachment
- Using Postman or other external system without requiring to use UI first:
- Stateful Authentication - https://{{host}}/api/rd/v1/Core/LogIn?username={{username}}&password={{password}}&domain={{domain}}
- Initialize Quote in Session - https://{{host}}/api/rd/v1/Cart/GetInitData?cartId={{cartId}}&ownerId={{ownerId}}&mode=0
- Upload File - https://{{host}}/Cart/UploadCartAttachment
- Getting Cookies from CPQ Session in the Browser:
- 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
Keywords
Upload, File, Document, Postman, API, Quote 1.0, CPQ , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , How To
Product
SAP CPQ 2023
SAP Knowledge Base Article - Public