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

Data collection via nsapi REST

devmandan
Level 1
Level 1

Hi, I'm coming up to speed on the REST API documented in "Cisco Service Portal Integration Guide".  While working through some sample requests to get a feel for things I came across an issue fetching a catagory by name.

The guide has this sample in for "Get consumer service category by Name":

http://<ServerURL>/RequestCenter/nsapi/definition/categories/name/<categoryName>

A response from definition/categories?catalogType=offeringCatalog included this:

<category>

  <categoryId>2</categoryId>

  <categoryName>&lt;b&gt;Service Offerings&lt;/b&gt;</categoryName>

The category name is "<b>Service Offerings</b>" and this is giving me fits.  I've tried encoding a few ways:

  definition/categories/name/Service%20Offerings

  definition/categories/name/%3Cb%3EService%20Offerings%3C%2Fb%3E

I end up with HTTP/1.1 400 Bad Request or HTTP/1.1 404 Not Found.

This  exact request may not be required for us, but I need to master the API  and do not understand how to plug in a name as documented.  Can I get  some help with this example?  Also, if I come across other issues or have more questions, should I just keep using this discussion?  I'm not certain of the policy.

---

Adding another example of similar problem.

---

The doc says a service item may be fetched by name as follows:

http://<ServerURL>/RequestCenter/nsapi/serviceitem/<serviceItemName>

I am getting HTTP/1.1 404 Not Found for this request:

http://<ServerURL>/RequestCenter/nsapi/serviceitem/a6803a03-3c4d-db5b-8994-da383b9d8836

The service item name comes from a current service item in UI:

serviceItem.PNG

My goal is to get the service item details visible in UI using REST.

Thanks!

1 Accepted Solution

Accepted Solutions

meisenst
Level 4
Level 4

For the latter case, the Service Item Name is actually the name of the table, such as SiVirtualMachine.

You're looking at Service Item definitional information, not individual service items.

View solution in original post

2 Replies 2

meisenst
Level 4
Level 4

For the latter case, the Service Item Name is actually the name of the table, such as SiVirtualMachine.

You're looking at Service Item definitional information, not individual service items.

Latest block is how to filter.  I wish the doc had more literal examples instead of "serviceitemsubscription/".

Given the following snippet from serviceitemsubscription response with no filter:

  ...

 

  ...

   

    SiHosts

    Hosts

   

        vCenter.demo.local:HostSystem-host-13

        ...

How can I only fetch SiHosts or Hosts service items (not the real goal, but same approach applies to SiVirtualMachines).  The following attempts all fail:

serviceitems/serviceitemsubscription/logicName%3DSiHosts

serviceitems/serviceitemsubscription/logicName=SiHosts

serviceitems/serviceitemsubscription/name%3DHosts

serviceitems/serviceitemsubscription/name=Hosts

I'm not sure what are valid column names and going by the XML element names.  Can you help me with syntax to only get service items of interest based on Si type name?

Review Cisco Networking for a $25 gift card