New API, post method not working
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎12-08-2021 01:57 AM
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
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"
}
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 | ||||||
|
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎12-08-2021 09:27 AM
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?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎12-08-2021 09:15 AM
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
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎12-08-2021 04:24 AM
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
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
