cancel
Showing results for 
Search instead for 
Did you mean: 

New API, post method not working

New API, post method not working

grech659
New Contributor
Hey guys,

I've been playing around with the new API and absolutely loving it. Big improvement over the old one!

Everything seem to be working great except post methods. For example, I'm trying to grant and external user access following the below documentation.
Swagger UI
Extremecloudiq remove preview
Swagger UI
View this on Extremecloudiq >

I'm using the following URL - https://api.extremecloudiq.com/users/external

Not matter what I put in the body I always get an 400 error as per below.

{
"error_code": "INVALID_ARGUMENT",
"error_id": "b4c66c4cc3284a6dbb66234c17334d5d",
"error_message": "INVALID_ARGUMENT: core.service.invalid.data"
}

I've tried multiple different user accounts but always the same outcome. Any known issues at all?

Any help is much appreciated.

Cheers

Update: Including Raw Output with username replaced.

POST /users/external HTTP/1.1
Authorization: Bearer [Placeholder token]
Host: api.extremecloudiq.com
Content-Type: application/json
Content-Length: 116

{
"login_name": "xxxx.xxxx@xxxx.nz",
"user_role": "ADMINISTRATOR",
"enable_api_access": "true"
}
7 REPLIES 7

Kurt_Semba
Extreme Employee
Thanks for sharing your findings. That acutally makes sense: a guest admin should not have the capability to add external admins to the XIQ account. Is that "guest admin" a local admin with the "Guest Management" role?

grech659
New Contributor
Hey Kurt,

Thanks for the response. I've just done some more playing around and think I have isolated the issue.

It seems to be working fine if I try with a login local to that instance. I'm currently trying with guest admin account(Administrator with API enabled) with access token being generated with the /account/:switch method which is causing the issue. So seems guest admins with API access enabled has no write/post access?

Cheers

Kurt_Semba
Extreme Employee
Congratulations on being the first one to post a question into our new API community 🙂

I just gave this API call a try using the Swagger page and it worked fined. I tried it with two accounts (email addresses) from colleagues who have XIQ accounts but are not yet added to my demo XIQ. I gave them both the ADMINISTRATOR role and one I allowed API access as well, the other one I set that parameter to false. Example curl command that Swagger auto-generated:

curl -X POST "https://api.extremecloudiq.com/users/external" -H "accept: application/json" -H "Authorization: Bearer bearer_token_removed" -H "Content-Type: application/json" -d "{\"login_name\":\"colleague1_real_email_removed@extremenetworks.com\",\"user_role\":\"ADMINISTRATOR\",\"enable_api_access\":\"true\"}"

Are you logged in as an Administrator with full access rights to the API? I'm logged in with my main account - the email account that created my demo XIQ account. 
That external email that you are trying to add: is this an already existing user within some other XIQ account? I don't think you can add just any random email and invite that person. It probably needs to be an already registered user with some XIQ account (not yours, of course).

Kurt
GTM-P2G8KFN