Create order through SN Rest API

wakespirit
Kilo Guru

Dear all,

Hello,

I simply need to place an order from Service Catalog by using SN REST Api, 

The client is a chat bot

  1. the customer want to get its list of available assets in given category ( ex : computer).
  2. From the list of return assets, he will decide for instance to by a certain type of computer
  3. Then an order will be place and created for the item in order to place that Computer order with all details.
  4. The all information of created order should be send back to customer as part of web service response

 

Could you please describe more clearly :

- Which REST API tables will be used in order to complete the  request and how many request should be send ?

( I have seen that order create a Request and Request Item in task table and then a link to sc_req_item table)
 

- How to return to client a formatted return response with collection of placed order information ? is it native or need to create custom web service to merge data in a single response ? 

Thanks for help on this

 

1 ACCEPTED SOLUTION

Hi, Those chocies are into another table not sure the table name may be sys_choice and you can match them with element (name of the variable). Please login to servicenow, open variable type select, then in related list, you can see choices. You can open into new tab by fright click the filter(blue text ) and in url you can get the table name. You need to again query the choice table to get correct choices for that variable.

View solution in original post

9 REPLIES 9

Hi, Those chocies are into another table not sure the table name may be sys_choice and you can match them with element (name of the variable). Please login to servicenow, open variable type select, then in related list, you can see choices. You can open into new tab by fright click the filter(blue text ) and in url you can get the table name. You need to again query the choice table to get correct choices for that variable.

Rohit Kaintura
Mega Guru

So you can use catalog api and chat api for this:

 

https://docs.servicenow.com/bundle/istanbul-servicenow-platform/page/integrate/inbound-rest/concept/...

 

and then you can inject those values in your chat conversation. For that see this

 

https://community.servicenow.com/community?id=community_question&sys_id=94b2cf21dbd8dbc01dcaf3231f96...

 

I could not see the catalog service API in REST API explorer, is it present ?

 

Next is that I have no issue to collect asset in a given category but the goal I am try to get at the end is the following :

1- Imagine user connect to chat and said " I would like to order a computer"

At this type I would like the REST API to look for items in catalog which are in category computer .

How do I know from the chat message that order is not a category but computer is ?

 

I try to create a full order path from a chat bot kind system

Ayn idea ?

I guess you can do this by making a connect action but it would be a static option for some catalog items. In that, you can use catalog api and its different from rest api. You don't need to use rest api. 

sorry did not catch your idea.

I am new to this process and need to build a study pilot 

can you clarify each steps if you do not mind, would be helpful to me

regards