Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #%RAML 0.8
- title: auth
- version: 1
- baseUri: http://test.loc/api
- /user:
- /auth:
- post:
- description: User login
- responses:
- 200:
- body:
- application/json:
- example: |
- {
- "status":true,
- "message":"user was logged",
- "data":{
- "auth":{
- "token":"JwCNJilKCpCcYY6AN0IpYSVNgWwNLLo",
- "created_at":"2016-03-31 04:12:57",
- "expired_at":"2016-04-30 04:12:57"
- },
- "profile":{
- "disability":"hearing"
- }
- }
- }
- schema: |
- {
- "type": "object",
- "required": true,
- "properties": {
- "status": {
- "type": "boolean",
- "required": true
- },
- "message": {
- "type": "string",
- "required": true
- },
- "data": {
- "type": "object",
- "required": false,
- "properties": {
- "token": {
- "required": true,
- "type": "object",
- "properties": {
- "token": {
- "required": true,
- "type": "string"
- },
- "created_at": {
- "required": true,
- "type": "string"
- },
- "expired_at": {
- "required": false,
- "type": "string"
- }
- }
- },
- "auth":{
- "required": true,
- "type": "object",
- "properties": {
- "firstname": {
- "required": false,
- "type": "string"
- },
- "lastname": {
- "required": false,
- "type": "string"
- },
- "gender": {
- "required": false,
- "type": "int"
- },
- "dob": {
- "required": false,
- "decription": "date of birtday",
- "type": "string"
- },
- "profession_id": {
- "required": false,
- "type": "int"
- },
- "detailed_profession": {
- "required": false,
- "type": "string"
- },
- "country_id": {
- "required": false,
- "type": "int"
- },
- "city_id": {
- "required": false,
- "type": "int"
- },
- "detailed_city": {
- "required": false,
- "type": "string"
- },
- "url_photo": {
- "required": false,
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- 403:
- body:
- application/json:
- example: |
- {
- "status":false,
- "message":"user was not logged",
- "errors": {
- "username": ["Username cannot be blank."]
- }
- }
- schema: |
- {
- "type": "object",
- "required": true,
- "properties": {
- "status": {
- "type": "boolean",
- "required": true
- },
- "message": {
- "type": "string",
- "required": true
- },
- "errors": {
- "type": "object",
- "required": false,
- "properties": {
- "username": {
- "required": false,
- "type": "array"
- },
- "password": {
- "required": false,
- "type": "array"
- }
- }
- }
- }
- }
- 405:
- body:
- application/json:
- example: |
- {"status":false,"message":"invalid method"}
- queryParameters:
- username:
- required: true
- password:
- required: true
- /register:
- /index:
- post:
- description: registration
- responses:
- 200:
- body:
- application/json:
- example: |
- {"status":true,"message":"user was register and logged","data":{"auth":{"token":"n0D5RvwA7H1NLUX_CJbsN7ckMlX6wRwv","created_at":"2016-03-31 14:56:43","expired_at":"2016-04-30 14:56:43"},"profile":{"disability":"hearing"}}}
- schema: |
- {
- "type": "object",
- "required": true,
- "properties": {
- "status": {
- "type": "boolean",
- "required": true
- },
- "message": {
- "type": "string",
- "required": true
- },
- "data": {
- "type": "object",
- "required": false,
- "properties": {
- "token": {
- "required": true,
- "type": "object",
- "properties": {
- "token": {
- "required": true,
- "type": "string"
- },
- "created_at": {
- "required": true,
- "type": "string"
- },
- "expired_at": {
- "required": false,
- "type": "string"
- }
- }
- },
- "auth":{
- "required": true,
- "type": "object",
- "properties": {
- "firstname": {
- "required": false,
- "type": "string"
- },
- "lastname": {
- "required": false,
- "type": "string"
- },
- "gender": {
- "required": false,
- "type": "int"
- },
- "dob": {
- "required": false,
- "decription": "date of birtday",
- "type": "string"
- },
- "profession_id": {
- "required": false,
- "type": "int"
- },
- "detailed_profession": {
- "required": false,
- "type": "string"
- },
- "country_id": {
- "required": false,
- "type": "int"
- },
- "city_id": {
- "required": false,
- "type": "int"
- },
- "detailed_city": {
- "required": false,
- "type": "string"
- },
- "url_photo": {
- "required": false,
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- 405:
- body:
- application/json:
- example: |
- {"status":false,"message":"invalid method"}
- 403:
- body:
- application/json:
- example: |
- {"status":false,"message":"user was register but not logged"}
- /check-username:
- get:
- description: check username
- responses:
- 200:
- body:
- application/json:
- example: |
- {
- "status":true,
- "message":"username status",
- "data":{
- "username":"235fdgh237",
- "exists":true
- }
- }
- schema: |
- {
- "type": "object",
- "required": true,Улица Монстро, 10
- "properties": {
- "status": {
- "type": "boolean",
- "required": true
- },
- "message": {
- "type": "string",
- "required": true
- },
- "data": {
- "type": "object",
- "required": true,
- "properties": {
- "username": {
- "required": true,
- "type": "string"
- },
- "exists": {
- "required": true,
- "type": "boolean"
- }
- }
- }
- }
- }
- 405:
- body:
- application/json:
- example: |
- {"status":false,"message":"invalid method"}
- queryParameters:
- username:
- required: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement