memonic

Users Resource

The users resource represents a list of users. Specifically it is always a one-item list containing just the current user.

Resource URL: https://api.memonic.com/v2/users?apikey={yourkey}

MethodPurpose
GET Returns a one-element list referencing the logged in user.
POST Create a new user.

GET

The GET method on the users resource returns a one-element list containing the ID of the current user.

Response

Status codes

The following response status codes can be returned.

CodeReason
200 All good. Response body is enclosed.
401 Not logged in or invalid Authorization header.

In case of a successful 200 response the following output is returned:

XML

<users>
    <user order="0">
        <id>logged_in_user_id</id>
    </user>
    <link href="https://api.memonic.com/v2/users.xml?apikey={yourkey}" order="0" rel="self"/>
    <link href="https://api.memonic.com/v2/users.xml?apikey={yourkey}" order="1" rel="first"/>
    <link href="https://api.memonic.com/v2/users.xml?apikey={yourkey}" order="2" rel="last"/>
</users>

JSON

{
  "pagination": {
    "count": 1, 
    "last": 1, 
    "pagesize": 10, 
    "first": 1
  }, 
  "users": [
    {
      "id": "logged_in_user_id"
    }
  ]
}

POST

The POST method on the users resource is used to create new users.

Request

Input data should be transmitted in the post body using the application/x-www-form-urlencoded content type.

POST parameters

ParamPurposeValidation
email Email address of the new user account. A mail to confirm the address will be sent. Valid email address
password The password of the new user account. Mandatory
password2 Password verification. Needs to match the password
newsletter Whether the user wants to subscribe to the newsletter. 0 or 1 (indicating false or true respectively)
accept_gtc Flag for user accepting the general terms and conditions. You should provide a link to our General Terms and Conditions for the user to read. Must be 1 to indicate the user accepted the terms

Response

Status codes

The following response status codes can be returned.

CodeReason
201 The user was successfully created.
400 Input error. Any of the input data does not conform to the required format.
503 Registration disabled. We reserve the right to temporarily disable creation of accounts through the API in case of abuse.

In case of a successful 201 response the following output is returned:

XML

<user>
    <id>created_user_id</id>
    <email>user@example.com</email>
    <link href="https://api.memonic.com/v2/users.xml?apikey={yourkey}" order="0" rel="self"/>
</users>

JSON

{
  "id": "created_user_id", 
  "email": "user@example.com"
}