New users: create a use.id from within your app

Now that you are able to authenticate your app against its WebID using DPoP, you can access our API's (or at least the parts that your app has access to).

The first thing you probably want to do is to create use.id accounts for the users of your application via our API's.

To do this, you are able to use our provisioning endpoint. Don't worry once you are authenticated againts your application's WebID, creating or provisioning use.id accounts is a breeze!

My Move: create an account on the Sandbox environment

My Move allows new users to create a new use.id WebID from within their app.

My Move allows new users to create a new use.id WebID from within their app.

You can send a request to the /provision endpoint on sandbox.api.use.id to create a use.id WebID for one of your users.

Below you can find an example of such a request in which the My Move app creates an account for one of its users: John. John's WebID should be sandbox.use.id/john and his email address is [email protected].

POST https://sandbox.api.use.id/provision
Content-Type: application/json
Slug: john
Authorization: DPoP eyJhbGciOiJFUzI1NiIsImtpZCI6IjI4YzBkODk5LTg0YTktNDUwOC1hYTliLTJhOTdlMjFmMjVmOCIsInR5cCI6ImF0K2p3dCJ9.eyJodHRwczovL3Rlc3QudXNlLmlkL3dlYmlkIjoiaHR0cHM6Ly90ZXN0LndlYmlkLmlub3guYXBwLyIsImlzcyI6Imh0dHBzOi8vdGVzdC5pZHAudXNlLmlkLyIsInN1YiI6Iml0TGtqYms3Rldpa01kQktkQ0hTVTJVQ0ZrS29iWXlaQGNsaWVudHMiLCJhdWQiOlsiaHR0cHM6Ly91c2VpZC10ZXN0LmV1LmF1dGgwLmNvbS9hcGkvdjIvIiwic29saWQiXSwiaWF0IjoxNjYwODEzODU2LCJleHAiOjE2NjA5MDAyNTYsImF6cCI6Iml0TGtqYms3Rldpa01kQktkQ0hTVTJVQ0ZrS29iWXlaIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIiwiY25mIjp7ImprdCI6ImJ0SUVlM21GbmpERW82VVpxeFh4RHhSUHhTdWpIZWlUQjV5U25sMVpUT28ifSwid2ViaWQiOiJodHRwczovL3Rlc3Qud2ViaWQuaW5veC5hcHAvIiwianRpIjoiZjZhYmQ5NTItM2E0Mi00NTdhLWE3MDEtYWQ4MTI5MDhkMTRiIn0.tZyG7QzSLckxIl6hOWW1EdLSi79tNSrEHo0GxHl1FX-J8W-uniKFFo7YvVnZ2H8-_sUtAwplLklhtUGitYyuNg
DPoP: eyJhbGciOiJFUzI1NiIsImp3ayI6eyJjcnYiOiJQLTI1NiIsImt0eSI6IkVDIiwieCI6Ik5tVjQ2UENzSndBOXFwdW4xeUtvckx0ejFodk4yU2ZKN3h0U2JSTlJQMHciLCJ5IjoiM0wyN040TjRXdy1QQWlXelV2alo2UXFvem9kUkRsUmJERERBU201cGdXbyJ9LCJ0eXAiOiJkcG9wK2p3dCJ9.eyJodG0iOiJQT1NUIiwiaHR1IjoiaHR0cHM6Ly90ZXN0LmFwaS51c2UuaWQvcHJvdmlzaW9uIiwiaWF0IjoxNjYwODEzODY3LCJqdGkiOiJjM2UxNjhmYi1kYmMwLTQ2OGEtYmFkNS02MWM0ZTk4NWI2MGQifQ.KLhm-1LBopY5iq2QHXPikZDnJ5CXeQUwAGCL-oI896o_gtyotzquQGG8QD1LjVQ_wirbvb6_zw3SilJ3EPiQgw
Content-Length: 47

{
	"email": "[email protected]"
}

If the request was successful, the API will return a 201 'Account Created' message.

We've also created a recipe for this example (see below) and documented the full endpoint in our API's reference documentation.

UX: Check whether accounts are already taken on the fly

On the registration page, My Move also checks whether a username is already taken while the user is typing his or her desired username. This is because, otherwise, the user might be blocked later on.

To check whether the username 'john' is already taken on the Sandbox environment, the My Move developers perform the following call:

GET https://sandbox.use.id/john/profile

The developers would receive one of the two following responses:

  • If "john" would be already taken: 200 OK
  • If "john" is not taken: 401 Unauthorized