API cmdb.object.create categories
-
Hallo,
laut Doku kann man bei cmdb.object.create auch gleich Attribute in Kategorien schreiben, was einige API Aufrufe erspart:
categories
Object with Array
Category constant, for example: "C__CATG__MODEL" with keys in a arrayNach etwas rumprobieren habe ich folgende Möglichkeit gefunden mit der ich Daten schreiben kann:
{ "version": "2.0", "method": "cmdb.object.create", "params": { "apikey": "*****", "language": "en", "type": "C__NEUER_OBJEKTTYP_ZZ_ALLE_KATEGORIEN", "title": "test_2025-11-20-05", "categories" : { "C__CATG__CUSTOM_FIELDS_NETZ_INFO" : [ {"f_text_nautobot_name" : "asdf"}, {"f_text_nautobot_id" : "12335"} ] } }, "id": 1 }Kann jemand bestätigen, dass dieses Format richtig ist?
Wenn ja, wäre es sinnvoll, die API Dokumentation um so ein Beispiel zu erweitern und evtl. das "keys in array" besser zu formulieren. Es gibt ja mehrere Möglichkeiten dies zu implementieren.Grüße
Leo
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login