In my application, once a user have registered, I need to query a remote, external API using some of the data she provided.
After receiving an answer from the remote API, I need to store the returned data as part of the user’s profile.
I’m using the PHP SDK and have 2 questions related to the above:
in the context of the beforeRegister / afterRegister functions, how can I change the $user_values array so that the changes I do are persisted?
How can I perform an HTTP call to a remote REST API from one of the beforeRegister / afterRegister functions?
1) in the context of the beforeRegister / afterRegister functions, how can I change the $user_values array so that the changes I do are persisted?
You would do it exactly the same way as you modify any other object in PHP. There is absolutely nothing special $user_values, it is just a PHP object array…
2) How can I perform an HTTP call to a remote REST API from one of the beforeRegister / afterRegister functions?
Once again, you would do it the same way you make an HTTP call to a rest API in PHP