Skip to content

API User

mkb edited this page Jul 4, 2013 · 1 revision

User

Get a user

This request will deliver the either the user model (if logged in) or the two URLs for registering and "I forgot my password".

/user

Example 1: The user is not logged in or even registered

HTTP GET Request: http://www.example.com/rest.php/user

GET Variables: none

Reply:

{
	"register_url": "\/Home\/specialpage\/register",
	"pwreset_url": "\/Home\/specialpage\/pwreset"
}

Example 2: The user is logged in

HTTP GET Request: http://www.example.com/rest.php/user

GET Variables: none

Reply:

{
	"Name": "Toni",
	"Logo": "\/typo3conf\/ext\/we_betatext\/default.jpg",
	"Verified": 1,
	"profile_url": "\/Home\/specialpage\/editprofile"
}

Login

There are 3 different possible replies:

  1. 200 - User Model JSON
  2. 401 - 'Authentication failed'
  3. 401 - 'User not found'

HTTP POST Request: /login

POST Variables:

{
	"username": "Alice@example.com",
	"password": "ieV8Lu5Oophu"
}

Reply:

{
	"Name": "Alice",
	"Logo": "\/typo3conf\/ext\/we_betatext\/default.jpg",
	"Verified": "0"
}

Logout

This request will be replied with in any case with the two URLs to register and reseting the password.

HTTP POST Request: /logout

POST Variables: none

Reply:

{
	"register_url": "\/Home\/specialpage\/register",
	"pwreset_url": "\/Home\/specialpage\/pwreset"
}

Home > API

Requests

  • Text
    • get a commentable text
  • Comment
    • get a comment
    • post a new comment
    • delete a comment
  • Vote
    • like/dislike a comment
  • User
    • get the logged in user
    • login a user
    • logout a user
  • Process Step
    • get the process steps of a text

Models

Clone this wiki locally