Create user via Management API? (using auth0-PHP)

I can’t seem to get a create user request to work. I’m getting a 400 Bad Request reply every time.
I assume it’s due to the body parameter being wrong in some way, but there seems to be no way for me to know what’s wrong with it.

My example:

$management->users()->create(“Username-Password-Authentication”, [ “email” => “tj@inthooz.com”, “phone_number” => “+199999999999999”, “password” => “H6e>@i9KZmVd}'S;”, “email_verified” => true ] );

Scratch that. I figured it out!

  1. I wasn’t using the HttpResponse::decodeContent() method on the response. That’s why I didn’t get any useful feedback.

  2. Once I added that, the API helpfully told me that the phone number was not allowed.

2 Likes

Thank you for sharing your solution with us! :clap: :+1:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.