cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
426
Views
2
Helpful
2
Replies

Automated Software Distribution API

qball359
Level 1
Level 1

Hi all

Not sure if I'm just not understanding correctly, but I can't figure out how to use the Automated Software Distribution API.

I've gotten approved for the specific API and it's added my application on the API Console.

I'm directed to use URIs such as https://apix.cisco.com/software/v4.0/metadata/pidimage but I can never get any valid response.  In other APIs, I can adjust the URI with a device model or similar, but that doesn't seem to be the case with this one.

When attempting a POST send, I get "Error 400 Bad Request - Invalid Input" if I send https://apix.cisco.com/software/v4.0/metadata/pidimage/C9200L-48P-4G

The API guide doesn't seem to tell me how to use the API to get anything specific - it just directs to use the URI and then provides sample responses - ones that I can't get. 

I'm not sure if I'm just missing something obvious, but can anyone help?

 

1 Accepted Solution

Accepted Solutions

Jesus Illescas
Cisco Employee
Cisco Employee

The example they provide says to put the image pid and name as part of the payload you need to send to the API. How your payload looks like? I recommend using curl

POST https://apix.cisco.com/software/v4.0/metadata/pidimage

Content-Type: application/json

{
    "pid": "ASR10012XOC3POS-RF",
    "imageNames": [
        "testfile1.exe",
        "testVPN_3.bin"
    ],
    "pageIndex": "1",
    "perPage": "1"
}

The API also says the fields PID and imageNames are required

https://developer.cisco.com/docs/support-apis/automated-software-distribution/#software-release-by-pid-and-image

View solution in original post

2 Replies 2

Jesus Illescas
Cisco Employee
Cisco Employee

The example they provide says to put the image pid and name as part of the payload you need to send to the API. How your payload looks like? I recommend using curl

POST https://apix.cisco.com/software/v4.0/metadata/pidimage

Content-Type: application/json

{
    "pid": "ASR10012XOC3POS-RF",
    "imageNames": [
        "testfile1.exe",
        "testVPN_3.bin"
    ],
    "pageIndex": "1",
    "perPage": "1"
}

The API also says the fields PID and imageNames are required

https://developer.cisco.com/docs/support-apis/automated-software-distribution/#software-release-by-pid-and-image

Thanks very much - I wasn't properly understand the guide in terms of sending a payload along with the API query; I was anticipating that it would function like the Software Suggestion API where I just send a GET request - something like 

 
I've successfully sent a test query to the the API using Insomnia, crafting the payload to use the PID "C9300L-48P-4G" and a known filename, which has worked successfully, giving me the API output correctly.