09-10-2024 12:05 AM
Hi
Anybody using the CCWR List Quote API successfully?
According to the documentation the endpoint is https://apix.cisco.com/ccw/renewals/api/v1.0/quote/manager (POST) and the only mandatory field is "billToLocation" (as a list of integers):
{
"billToLocation":[123456789]
}
Sending the request (Bearer Authorization Token is OK and for sure I change 123456789 to my acutal BID) results in a HTTP 400/bad request.
Any help is very much appreciated
Marcel
09-10-2024 02:40 AM
@Marcel Zehnder i dont know this doc/api. Only thing i can think of is if the API requires the list to be wrapped in square brackets? I had a look and cannot find any code examples
{
"billToLocation": [123456789]
}
Bit of an old thread, but has a contact email on there https://community.cisco.com/t5/services-discussions/ccw-r-api-availability/td-p/3599580
Update whilst replying, i found the doc here https://apidocs-prod.cisco.com/explore;category=6083723925042e9035f6a750;epname=6083723a25042e9035f6a769;apiendpt=642f09ead0cb02238b1dae31
What i noted was this
billToLocation[] integer billToLocation
I am 100% guessing here mate, purely based on the provided snippet "billToLocation[]integerbillToLocation," it seems there might be a formatting issue or a misunderstanding in the documentation. This leads me to think the most likely interpretation that the billToLocation
field is an array (or list) containing one or more integer values, hence this is denoted by square brackets []
in JSON.
Try the square brackets, if that breaks again, i would go via the email and ask what the support for this API is or some working examples.
Hope this helps.
09-10-2024 03:23 AM
Thanks mate, I was thinking the same and therefore alreday tried almost all possbile options. I tried with the following JSON payloads, all resulting in 400 bad request:
# int
{
"billToLocation": 123456789
}
# string
{
"billToLocation": "123456789"
}
# int-array
{
"billToLocation": [123456789]
}
# string-array
{
"billToLocation": ["123456789"]
}
09-10-2024 03:47 AM
@Marcel Zehnder yes odd, i then saw the example code... (below), i wondering if this is not the only mandatory field you need, i hoped the 400 error should have typically come with more details in the response body to help clue you in.
the example code shows - {
"billToLocation": 80616,
"createdBy": "rkatkam",
"daysBeforeToday": 10,
"fromDate": "02-02-2020",
"lastUpdateDaysBeforeToday": 10,
"lastUpdateFromDate": "02-02-2023",
"lastUpdateToDate": "03-02-2023",
"limit": 1000,
"offset": 0,
"quoteSource": [
"API/B2B"
],
"quoteStatus": [
"Valid"
],
"quoteType": [
"SFC"
],
"resellerBillToLocation": [
82555
],
"toDate": "03-02-2020"
}
10-11-2024 06:39 AM - edited 10-11-2024 06:41 AM
I just discovered what's the problem with my requests:
Make sure to set the Request-id HTTP header (a random int) when using the API. According to the documentation (https://www.cisco.com/E-Learning/gbo-ccw/cdc_bulk/Cisco_Commerce_B2B_Implementation_Guides/Implementation_Guides/CCWR/List_Quote_API/List_Quote_API_IG.V.3.0.pdf / page 8 / section 2.4) this property is optional, turned out it isn't.
Regarding the payload, the only mandatory field is "billToLocation" as a list/array of integers:
{
"billToLocation":[10000001]
}
Hope this helps
10-11-2024 06:50 AM
@Marcel Zehnder one would not have figured that out in a million years!
10-13-2024 11:08 PM
@bigevilbeard It was kind of a lucky punch - I noticed in other CCWR-related API docs, the paramater was listed as a required, so I gave it a try.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide