Users¶
Collection of user representations.
You create new users by posting to this collection. To see what fields you should post and what errors you can expect when creating users look at the documentation for the user resource.
Creating user accounts¶
This is the standard way to create new user accounts. New users will not be able to log in to the site until they have confirmed their email address by clicking a link contained in an email sent to their address. It is not possible to specify a password when creating an account. Directly after confirming an account the user will be prompted to set a password.
Creating user accounts is currently restricted to clients authenticating with client credentials.
These clients should use a token that has the create_account
scope. Read more about this in the
Obtaining an Access Token for a client section of the authentication chapter.
Reference¶
GET /v1/users
Currently returns an empty resource with an item link
POST /v1/users
Create a new user
Examples¶
Retrieving the users collection :
Request :
GET /v1/users HTTP/1.1 Host: api.marktplaats.nlResponse :
HTTP/1.1 200 OK Content-Type: application/json { "_links": { "self": { "href": "/v1/users", "title": "Access to users" }, "describedby": { "href": "https://api.marktplaats.nl/docs/v1/users.html" }, "item": { "href": "/v1/users/{userId}", "templated": true } } }
Creating a new account :
Request :
POST /v1/users HTTP/1.1 Host: api.marktplaats.nl Content-Type: application/json { "email": "user@host.nl", "name": "Spiderman", "postcode": "1097DN", "phoneNumber": "0204167248" }Response :
HTTP/1.1 201 OK Content-Type: application/json Location: /v1/users/3078 { "_links": { "self": { "href": "/v1/users/3078" }, "curies": [ { "href": "https://api.marktplaats.nl/docs/v1/{rel}.html", "templated": true, "name": "mp" } ] }, "userId": 3078, "email": "user@host.nl", "name": "Spiderman", "postcode": "1097DN", "phoneNumber": "0204167248", "status": "confirmed" }