Skip to content
Gabriel Rascovit edited this page Aug 25, 2017 · 3 revisions

Questions Collection [/api/v1/questions]

List questions [GET]

Returns a collection of questions. Requires the Authorization header to be present and be a valid API key (e.g Token token=3501ee988ad4dc9c2ea51c28ff48c425). Each question includes user, answers and answer user. If the 'query' param is present, then return only questions that contain the specified query on it's title (case insensitive).

  • Headers

    Authorization: Token token=a valid Tenant API key
    
  • Parameters

    • query (optional)
  • Request (application/json)

      {
          "query": "something that is in question title"
      }
    
  • Response 200 (application/json)

      [
          {
              "id": 4,
              "title": "Shoreditch messenger bag mustache moon before they sold out yr salvia jean shorts?",
              "private": false,
              "created_at": "2017-08-23T20:01:17.704Z",
              "updated_at": "2017-08-23T20:01:17.704Z",
              "user": {
                  "id": 10,
                  "name": "Santo Wilderman",
                  "created_at": "2017-08-23T20:01:17.463Z",
                  "updated_at": "2017-08-23T20:01:17.463Z"
              },
              "answers": [
                  {
                      "id": 7,
                      "body": "Cred synth aesthetic fanny pack photo booth Williamsburg mixtape.",
                      "created_at": "2017-08-23T20:01:17.714Z",
                      "updated_at": "2017-08-23T20:01:17.714Z",
                      "user": {
                          "id": 12,
                          "name": "Riley Friesen",
                          "created_at": "2017-08-23T20:01:17.494Z",
                          "updated_at": "2017-08-23T20:01:17.494Z"
                      }
                  },
                  {
                      "id": 8,
                      "body": "Lo-fi mustache VHS Carles Brooklyn synth.",
                      "created_at": "2017-08-23T20:01:17.724Z",
                      "updated_at": "2017-08-23T20:01:17.724Z",
                      "user": {
                          "id": 11,
                          "name": "Sindy Renner",
                          "created_at": "2017-08-23T20:01:17.470Z",
                          "updated_at": "2017-08-23T20:01:17.470Z"
                      }
                  },
                  {
                      "id": 9,
                      "body": "High life scenester thundercats gluten-free whatever Portland 8-bit irony.",
                      "created_at": "2017-08-23T20:01:17.733Z",
                      "updated_at": "2017-08-23T20:01:17.733Z",
                      "user": {
                          "id": 11,
                          "name": "Sindy Renner",
                          "created_at": "2017-08-23T20:01:17.470Z",
                          "updated_at": "2017-08-23T20:01:17.470Z"
                      }
                  }
              ]
          }
      ]
    
Clone this wiki locally