VMware Modern Apps Community
AbhishekSK
Hot Shot
Hot Shot
Jump to solution

Issue creating user with API.

Hi,

I am trying to create a user in wavefront via the API. But getting 400 even though it’s a valid email. Can you check and let me know if I am doing something wrong.

suhails-MacBook-Pro:Desktop suhail$ python wavefront.py

Headers: {'Content-type': 'application/x-www-form-urlencoded', 'Accept': 'application/json', 'x-auth-token': '**********'}

Payload: {"customer": "citrix", "identifier": "some.user@company.com", "groups": ["agent_management", "host_tag_management", "events_management", "alerts_management", "dashboard_management", "embedded_charts", "ingestion", "user_management", "browse"]}

400

{"error":"parameter_error","message":"null is an invalid email address","trackingId":"0e1aeb3e-eccf-4314-a9b9-0190d6adac8b"}

suhails-MacBook-Pro:Desktop suhail$

Thanks,

Suhail

0 Kudos
1 Solution

Accepted Solutions
AbhishekSK
Hot Shot
Hot Shot
Jump to solution

Hi Suhail,

The /api/user/create method expects a x-www-form-urlencoded payload and it looks like in your example you are trying to send a JSON object. Could you please try again using the following payload and let us know if it works?

id=mohan.kaimal%40citrix.com&groups=browse&groups=agent_management&groups=host_tag_management&groups=events_management&groups=alerts_management&groups=dashboard_management&groups=embedded_charts&groups=ingestion&groups=user_management&groups=browse 

-Vasily

View solution in original post

0 Kudos
2 Replies
AbhishekSK
Hot Shot
Hot Shot
Jump to solution

Hi Suhail,

The /api/user/create method expects a x-www-form-urlencoded payload and it looks like in your example you are trying to send a JSON object. Could you please try again using the following payload and let us know if it works?

id=mohan.kaimal%40citrix.com&groups=browse&groups=agent_management&groups=host_tag_management&groups=events_management&groups=alerts_management&groups=dashboard_management&groups=embedded_charts&groups=ingestion&groups=user_management&groups=browse 

-Vasily

0 Kudos
AbhishekSK
Hot Shot
Hot Shot
Jump to solution

Thanks a lot Vasily... It worked..

0 Kudos