use api to add cmdb item in service desk

using postman

POST https://api.samanage.com/configuration_items.json

Headers set to

Accept */*

Content-Type application/json

X-Samanage-Authorization with value Bearer <token value>

Body is marked raw sub type json

body value is copied out of the solarwinds docs

{
  "configuration_item": {
    "name""walrus",
    "description""Description",
    "type": {
      "name""Building"
    },
    "type_id"1,
    "asset_tag""ConfigurationItemTag",
    "site_id"1,
    "department_id"1,
    "state""Active",
    "manager": {
      "email""john.doe@email.com"
    },
    "user": {
      "email""jane.doe@email.com"
    },
    "add_to_tag_list""tag1, tag2",
    "remove_from_tag_list""tag3",
    "tag_list""tag1, tag2",
    "custom_fields_values_attributes": [
      {
        "id""1",
        "custom_field_id"1,
        "value""content"
      }
    ],
    "incident_ids": [
      100
    ],
    "problem_ids": [
      100
    ],
    "itsm_change_ids": [
      100
    ],
    "release_ids": [
      100
    ],
    "purchase_order_ids": [
      100
    ]
  }
}
response is 200 with body null
in other words its saying success but not giving any details
looking in the cmdb under buildings shows the item is not there.
Not sure what to change to make it work.
Parents Reply
  • I think the issue is that in the example payload, we offer 

    "site_id": 1,
    "department_id": 1,

    In your environment, those likely aren't valid Site/Department IDs. Since you removed those from the payload, it was able to work. You could potentially keep that in the payload, and just put a valid Site/Department ID and test to see if it's successful.

Children
No Data