Problems creating person objects
-
Hello,
I am relatively new to the I-Doit API. I have the following json request to create a new person object:
{ "method": "cmdb.object.create", "params": { "categories": { "C__CATG__LOGIN": { "disable_login": 1, "username": "logonname" }, "C__CATG__ORGANIZATION_ASSIGNMENT": { "assigned_organization": 31 }, "C__CATG__CONTACT": { "phone_company": "+049 3641 111 111" }, "C__CATG__PERSON": { "mail_address": "firstname.lastname@domain.com", "last_name": "lastname", "first_name": "firstname" } }, "title": "firstname lastname", "apikey": "apikey", "type": "C__OBJTYPE__PERSON" }, "id": 343653293, "jsonrpc": "2.0" }Unfortunately I always get the following error:
code=-32600; message=Invalid request : Provided request is not a valid json rpc.; data=
Can someone tell me what I am doing wrong here? The header is correct, it also works for creating server objects...
-
versuch es mal damit:
{ "method": "cmdb.object.create", "params": { "categories": { "C__CATG__LOGIN": [ { "disable_login": 1, "username": "logonname" } ], "C__CATG__ORGANIZATION_ASSIGNMENT": [ { "assigned_organization": 31 } ], "C__CATG__CONTACT": [ { "phone_company": "+049 3641 111 111" } ], "C__CATG__PERSON": [ { "mail_address": "firstname.lastname@domain.com", "last_name": "lastname", "first_name": "firstname" } ] }, "title": "firstname lastname", "apikey": "apikey", "type": "C__OBJTYPE__PERSON" }, "id": 343653293, "jsonrpc": "2.0" } -
And here are the corrected categories

{ "method": "cmdb.object.create", "params": { "categories": { "C__CATS__PERSON_LOGIN": [ { "disable_login": 1, "username": "logonname" } ], "C__CATS__PERSON_MASTER": [ { "assigned_organization": 31, "phone_company": "+049 3641 111 111", "mail_address": "firstname.lastname@domain.com", "last_name": "lastname", "first_name": "firstname" } ] }, "title": "firstname lastname", "apikey": "apikey", "type": "C__OBJTYPE__PERSON" }, "id": 343653293, "jsonrpc": "2.0" }You can find the Constants here -> https://kb.i-doit.com/en/i-doit-pro-add-ons/api/index.html#attribute-documentation
-
When facing problems creating person objects in programming, it often comes down to issues with class definitions, constructor parameters, or object instantiation. Make sure your class includes the correct attributes, that your constructors are properly defined, and that you’re passing the right types of values when creating each object. Debugging step by step—checking for typos, missing parameters, or incorrect method calls—can help identify the problem quickly.
Just like a fatgum cosplay jacket needs precise design and attention to detail to perfectly capture the character from Taishiro Toyomitsu, creating person objects requires careful structure and proper setup to function correctly. Both rely on accuracy and proper configuration to achieve the desired outcome.
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