I am using the following API to create a user under WSO2 identity server: /api/identity/user/v1.0/me with self registration process. The result in case of success is 201 created and an email is supposed to be sent to the user for verification. However as a backend application, i need to get the user id. how can i make the API return a user id of the created user?
POST /api/identity/user/v1.0/me
API doesn't return the created user's id in the response body/response header(as location).
[identity_mgt.user_self_registration]
enable_detailed_api_response = true
Additing this config into the deployment.toml will return detailed response about the notification sent for the API but it doesn't include the created user id.
As an alternative option, you can invoke the scim2/Users endpoint filtering the user by username and request only the id attribute. Please find the sample curl here:
curl --location 'https://localhost:9443/scim2/Users?filter=username%20eq%20john&attributes=id' \
--header 'Authorization: Basic YWRtaW46YWRtaW4='