SOLVED Create user via API

Status
Not open for further replies.

buffpuff

New Member
Oct 18, 2018
11
0
1
47
Hi Fusioners,
Every day that passes I am more and more astounded by the power of this software, it's lots of fun working with it.

I am trying to create a user via the API, for this I need to create a user and a contact, so I curl post the following:

curl -X POST -H "Content-Type: application/json" -d @/usr/src/user.json --insecure https://the.fusionpbx.url/app/api/6/users?key=API-Key

user.json:

{
"users": [
{
"user_uuid": "218eae29-c2fa-4455-8876-382256ced89c",
"domain_uuid": "54c1e797-1901-4a88-8d64-26085fe11987",
"username": "user-test",
"password": "0bb97a516c74cc64ef503e4332068084",
"salt": "6a344ffd-dc35-4dbb-87dd-9e654935d503",
"contact_uuid": "479a41cb-de0b-4362-858a-ba6a24d443bc",
"api_key": "fd01e77a-1beb-42c6-bf58-a64531fe8c85",
"user_enabled": "true",
}
]
}

But all I get in response is "not an arraynull" and no user added.


Creating the contact with an API call works fine, just the user fails.

Is creating a user via the API supported?
 

buffpuff

New Member
Oct 18, 2018
11
0
1
47
Found the problem, had a comma next to the last line ("true",).
Removed the comma and all is good.
 
Status
Not open for further replies.