cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1992
Views
0
Helpful
3
Replies

sn2info API discards records

rrawdonDotomi
Level 1
Level 1

Hello,

 

The SN2Info API documentation indicates that up to 75 serial numbers can be submitted per query.  Indeed, we can submit a request with 75 SNs, but if we submit 76 there is an error returned:

ERROR: _get_cisco_coverage_summary -  CR.get_cisco_coverage_summary: API call for coverage summary returned 400 Bad Request and 179-length content: {"ErrorResponse":{"APIError":[{"ErrorCode":"EXCEEDED_INPUTS","ErrorDescription":"Too many request parameters supplied","SuggestedAction":"Please consult the API documentation"}]}}

 

However, we have found that if we submit more than 50 serial numbers, those beyond 50 are silently discarded.  The API response includes no error, and no data on the extra serial numbers.  

 

We are not sure if the API always behaved this way, or if it started at a certain point.  We have been using the API for ~3 years and only recently had to investigate some data loss in our applications.

 

DEBUG: _get_cisco_coverage_summary -  Querying for 75 serials: (list of SNs redacted)

DEBUG: _get_cisco_coverage_summary -  Received coverage data for 50 serials.  return_coverage_summary contains 0 entries prior to this call

 

 

I confirmed this occurs for any serial number count over 50, not just ==75:

DEBUG: _get_cisco_coverage_summary -  Querying for 51 serials: (SNs redacted)

DEBUG: _get_cisco_coverage_summary -  Received coverage data for 50 serials.  return_coverage_summary contains 0 entries prior to this call

 

 

Can someone from Cisco comment on this?  It seems like perhaps there is pagination from an internal API on the Cisco side (page size = 50) which is not being taken into account, and >= 51 serials are being discarded

 

Thank you

 

1 Accepted Solution

Accepted Solutions

nmudiam
Cisco Employee
Cisco Employee

Hi, As you guessed it correctly, there is a pagination being applied in the "Get Coverage Summary by Serial Number(s)" response automatically and this is why a set of 50 SNs are returned by default in the API response. In order to see the rest of SNs in the response, please trigger call to the API with "page_index=2" request parameter as shown below:

 

https://api.cisco.com/sn2info/v2/coverage/summary/serial_numbers/{sr_no,sr_no,sr_no}?page_index=2

 

In short, you need to call the API couple of times (first one with 50 SNs by default and next one with page_index=2 for rest of the records), if the SN2 being input to the API is more than 50 (up to 75).

 

Hope this helps. 

    

View solution in original post

3 Replies 3

nmudiam
Cisco Employee
Cisco Employee

Hi, we'll check and get back to you with more details on this. Thank you! 

nmudiam
Cisco Employee
Cisco Employee

Hi, As you guessed it correctly, there is a pagination being applied in the "Get Coverage Summary by Serial Number(s)" response automatically and this is why a set of 50 SNs are returned by default in the API response. In order to see the rest of SNs in the response, please trigger call to the API with "page_index=2" request parameter as shown below:

 

https://api.cisco.com/sn2info/v2/coverage/summary/serial_numbers/{sr_no,sr_no,sr_no}?page_index=2

 

In short, you need to call the API couple of times (first one with 50 SNs by default and next one with page_index=2 for rest of the records), if the SN2 being input to the API is more than 50 (up to 75).

 

Hope this helps. 

    

This appears to be the case.  We did not expect pagination to be 50 when the API only takes up to 75 serial numbers per request.  Thank you