Skip to content

Directions

Vadim Sokoltsov edited this page Nov 13, 2016 · 4 revisions

GET /api/v1/users/:user_id/directions

Return list of user's directions

Request parameters

  • user_id - type: integer - id or nickname of user

Response parameters

  • id - type: integer - id of direction
  • title - type: string - Name of direction
  • description - type: text - Direction's description
  • percents_result - type: float - relation between finished and unfinished steps for direction

Response example

"directions": [
    {
      "id": 1600,
      "title": "Another direction",
      "description": "Description for this direction",
      "percents_result": null
    },
    {
      "id": 329,
      "title": "Rails 41",
      "description": "Rails 4 description",
      "percents_result": 0
    },
    {
      "id": 325,
      "title": "adaw",
      "description": "awdawd",
      "percents_result": 0
    },
    ...
]

GET /api/v1/users/:user_id/directions/:id

Return detailed direction information

Request parameters

  • user_id - type: integer - id or nickname of user
  • id - type: integer - id or slug of direction

Response parameters

  • id - type: integer - id of direction
  • title - type: string - name of direction
  • description - type: text - direction's description
  • percents_result - type: float - relation between finished and unfinished steps for direction
  • steps - type: array - list of directions steps
  • user - type: json - user information object
  • user.attachment - type: json - user avatar information

Response example

{
  "direction": {
    "id": 1600,
    "title": "Another direction",
    "description": "Description for this direction",
    "percents_result": null,
    "steps": [],
    "user": {
      "id": 22,
      "nick": "vforvad",
      "first_name": "Vadim",
      "last_name": "Sokoltsov",
      "description": "Software Engineer",
      "location": "Saint-Petersburg",
      "attachment": null
      }
    }
  }
}

Clone this wiki locally