- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2022 03:03 AM
Hello everyone,
I am trying to write a script to import multiple CI's into CMDB using REST API interface. I am testing the deployment in Postman, create a POST request and receive the following data:
"result": {
"items": [
{
"className": "cmdb_ci_router",
"sysId": "Unknown",
"identifierEntrySysId": "Unknown",
"errors": [
{
"error": "INVALID_INPUT_DATA",
"message": "In payload invalid data source [null] exist. You need to provide a valid choice value from field [discovery_source] in table [cmdb_ci]"
}
],
"identificationAttempts": [],
Obviously the error message suggests that field [discovery_source] is missing the correct info. I have tried to leave the field blank, putting in "None" or other name of existing discovery source, but still get the same error. Does it need to be an ID of a discovery source and if so, where do I find it?
Thanks
Solved! Go to Solution.
- Labels:
-
Instance Configuration

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2022 06:27 AM
can u try something like below ?
{
"attributes": {
"name" : "New_PC"
},
"source": "ServiceNow",
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2022 03:58 AM
can u share ur rest api end point ? is it custom or oob ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2022 05:54 AM
Hi Ravi, thank you for your reply. Sorry, but I'm not sure what you mean by rest api endpoint. If it is the URL, then it is
https://dev94109.service-now.com/api/now/v1/cmdb/instance/cmdb_ci_computer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2022 06:01 AM
ya this is what i was looking for , seems custom to me , at least i cant find this in my personal instance
if u r familiar with SN dev and code then you will have to go here
https://YOUR_INSTANCE_NAME.service-now.com/sys_ws_operation_list.do?sysparm_query=operation_uriLIKEcmdb_ci_computer&sysparm_view=
above is a sample link - put ur instance details in highlighted one and then see if u get any record in the list view , am assuming u will , hopefully one 🙂
u can look through the code to understand what param / validation it has which is causing ur error , if not sure u can share the code / screenshot here as well
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2022 06:22 AM
I am able to do a GET request successfully and do get a list of all the computer CIs from CMDB. Just not sure why I can't ignore the discovery_source field when trying to add the new one.