on 2024 Jul 01 11:50 AM
We are attempting to upload a file (pdf/jpg) from a public URL to CPQ. We are aware of the API {{url}}/Cart/UploadCartAttachment, but this attaches the document to the quote set in context.
Is there an API or method that allows us to attach a document/file to a quote with a specific quote ID?
Additionally, could you suggest how to call "/Cart/UploadCartAttachment" using a Python scripting REST client?
We have been using `requests.post(url, file)` and passing a byte array, but it does not seem to work.
Thank you,
Vaibhav Jadhav
Request clarification before answering.
Hi @vrjadhav ,
The API to facilitate the integration for uploading attachments to a quote in a customer project has not been officially published. However, the /Cart/UploadCartAttachment endpoint is utilized by the standard CPQ UI frontend for user interaction execution. This is a stateful API and relies on the X-CSRF-Token for quote context.
To invoke this API via your custom scripts, you'd need to obtain an X-CSRF-Token initially from an open target quote. Considering the different implementation approaches:
With respect to your specific use case, I recommend submitting an enhancement request in SAP CPQ | Customer Influence Portal to the SAP CPQ product team. This way, the development team can thoroughly analyze your business case and consider any possible recommendations or future improvements to better support your needs.
Best Regards.
Fancy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, looks like the solution is not working anymore, recently SAP introduced new 'feature':
"The UploadCartAttachment API (/Cart/UploadCartAttachment) has been updated. SAP CPQ has introduced AntiForgery validation for this API for security reasons. Now, when a user uses the drag and drop functionality for the Attachments feature on the Documents Tab of a Quote, SAP CPQ will send an additional token, "RequestVerificationToken," to ensure complete security. If the API is being used, it is important to ensure that the token is sent correctly in the headers with this request.' See link:
Do you know how I can obtain "RequestVerificationToken" so i can pass to the header while making a request?
Remember when doing upload via postman, it is important to pass to file as form-data in body, i tried to send this as raw and it didn't work. This note can help as well https://userapps.support.sap.com/sap/support/knowledge/en/3417551
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
8 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.