memonic

User Resource

The user resource represents an individual user. At the moment this resource can only be used for the logged in user herself.

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

MethodPurpose
GET Returns details about this user.

GET

The GET method on the user resource returns information about 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.
403 Permission denied. This is currently returned for all user resources except the one of the logged in user.
404 User not found.

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

XML

<user>
    <username>user_name</username>
    <quota>
        <items>
        <percent>90</percent>
        <state>90</state>
        <limit>100</limit>
        </items>
        <message>
        <status>warning</status>
        <text>You have used 90% of your free storage.</text>
        <text_formatted>You have used {strong}90%{endstrong} of your free storage.</text_formatted>
        <url>http://www.memonic.com/subscription/plans</url>
        <url_label>Go Premium now</url_label>
        </message>
        <plan>premium</plan>
        <groups>
        <percent>67</percent>
        <state>2</state>
        <limit>3</limit>
        </groups>
        <attachment>
        <limit>
            <bytes>2097152</bytes>
            <human>2 MB</human>
        </limit>
        </attachment>
    </quota>
    <id>user_id</id>
    <link href="https://api.memonic.com/v2/users/user_id.xml?apikey={yourkey}" order="0" rel="self"/>
    <email>email@example.com</email>
</user>

JSON

{
  "username": "user_name", 
  "email": "email@example.com", 
  "quota": {
    "items": {
      "percent": 90, 
      "state": 90, 
      "limit": 100
    }, 
    "message": {
      "status": "warning", 
      "text": "You have used 90% of your free storage.", 
      "text_formatted": "You have used {strong}90%{endstrong} of your free storage.", 
      "url": "http://www.memonic.com/subscription/plans", 
      "url_label": "Go Premium now"
    }, 
    "plan": "standard", 
    "groups": {
      "percent": 67, 
      "state": 2, 
      "limit": 3
    }, 
    "attachment": {
      "limit": {
        "bytes": 2097152, 
        "human": "2 MB"
      }
    }
  }, 
  "id": "user_id"
}

Some notable response fields:

FieldDescription
quota Contains information about the user's quota usage. One entry each for the Item limit, group limit and attachment size.
message Human-readable information to display the user about her quota status. status can be any of ok, warning or critical. If it is ok then all of the other message keys are not present.