The CreatorCon Call for Content is officially open! Get started here.

Adding CI using API interface

Sergey Lisitsin
Kilo Contributor

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

1 ACCEPTED SOLUTION

can u try something like below ? 

{
  "attributes": {
    "name" : "New_PC"
  },
  "source": "ServiceNow",

}

View solution in original post

13 REPLIES 13

Ravi, I tried to filter down by the sys id and it is still not found.

find_real_file.png

ok ! it says u searched with object id ? u sure u searched sys_id = "the value" right ? let me simulate in my personal instance too ! 

Ah! You are right, I have filtered on the wrong field. When I set it to sys_id, it finds the new PC

find_real_file.png

And now I can also see them all in the list!

find_real_file.png

Thank you very much for your help, Ravi!

 

i did find oob documentation though here