D4SD API

API Endpoint

Resource Group

Challenges

Microchallenges

GET /challenges?phase=&allPhases=&include=

Display a listing of the resource.
GET/challenges{?phase,allPhases,include}

URI Parameters
HideShow
phase
number (optional) 

Get challenges from specific phase.

allPhases
boolean (optional) Default: 0 

Get relations for each challenge from all phases.

include
string (optional) 

Relations to include

Choices: category resources questions insights{?:type()}


POST /challenges
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "name": "Name",
  "summary": "This is a challenge.",
  "description": "Challenge description"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 1,
    "name": "Consequatur voluptatem atque blanditiis.",
    "summary": "In vel eaque ut reprehenderit voluptates.",
    "thumbnail": "http://thumbnail.com/img.jpg",
    "phase": 2,
    "created_at": "2017-05-31 05:06:00",
    "updated_at": "2017-05-31 05:06:00"
  }
}

Store a newly created resource in storage.
POST/challenges


GET /challenges/id?phase=&allPhases=&include=
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 1,
    "name": "Consequatur voluptatem atque blanditiis.",
    "summary": "In vel eaque ut reprehenderit voluptates.",
    "thumbnail": "http://thumbnail.com/img.jpg",
    "phase": 2,
    "created_at": "2017-05-31 05:06:00",
    "updated_at": "2017-05-31 05:06:00"
  }
}

Display the specified resource.
GET/challenges/{id}{?phase,allPhases,include}

URI Parameters
HideShow
id
integer (required) 

ID of Challenge

phase
number (optional) 

Get relations from specific phase.

allPhases
boolean (optional) Default: 0 

Get relations from all phases.

include
string (optional) 

Relations to include

Choices: category resources questions insights{?:type()}


PUT /challenges/id
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "name": "Name",
  "summary": "This is a challenge.",
  "description": "Challenge description"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 1,
    "name": "Consequatur voluptatem atque blanditiis.",
    "summary": "In vel eaque ut reprehenderit voluptates.",
    "thumbnail": "http://thumbnail.com/img.jpg",
    "phase": 2,
    "created_at": "2017-05-31 05:06:00",
    "updated_at": "2017-05-31 05:06:00"
  }
}

Update the specified resource in storage.
PUT/challenges/{id}

URI Parameters
HideShow
id
integer (required) 

ID of Challenge


DELETE /challenges/id
Responses204
Headers
Content-Type: application/json

Remove the specified resource from storage.
DELETE/challenges/{id}

URI Parameters
HideShow
id
integer (required) 

ID of Challenge


GET /challenges/id/resources
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "name": "Test",
    "url": "http://test.com",
    "description": "Test description",
    "type": "PDF",
    "phase": 2,
    "challenge_id": 1,
    "updated_at": "2017-05-31 06:33:25",
    "created_at": "2017-05-31 06:33:25",
    "id": 23
  }
}

Get Resources belonging to Challenge
GET/challenges/{id}/resources

URI Parameters
HideShow
id
integer (required) 

ID of Challenge


POST /challenges/id/resources
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "name": "Test",
  "url": "http://test.com",
  "description": "Test description",
  "type": "PDF"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "name": "Test",
    "url": "http://test.com",
    "description": "Test description",
    "type": "PDF",
    "phase": 2,
    "challenge_id": 1,
    "updated_at": "2017-05-31 06:33:25",
    "created_at": "2017-05-31 06:33:25",
    "id": 23
  }
}

Store new Resource for Challenge
POST/challenges/{id}/resources

URI Parameters
HideShow
id
integer (required) 

ID of Challenge


GET /challenges/id/questions/?insights=
Responses200
Headers
Content-Type: application/json

Get Questions belonging to Challenge
GET/challenges/{id}/questions/{?insights}

URI Parameters
HideShow
id
integer (required) 

ID of Challenge

insights
boolean (optional) 

Include associated insights.


POST /challenges/id/questions
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "text": "What?"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 1,
    "text": "What?",
    "challenge_id": 1,
    "phase": 1,
    "created_at": "2017-05-31 17:00:27",
    "updated_at": "2017-05-31 17:18:28"
  }
}

Store new Question for Challenge
POST/challenges/{id}/questions

URI Parameters
HideShow
id
integer (required) 

ID of Challenge


GET /challenges/id/insights
Responses200
Headers
Content-Type: application/json
Body
{
  "data": []
}

Get Insights for Challenge
GET/challenges/{id}/insights

URI Parameters
HideShow
id
integer (required) 

ID of Challenge


Slack Channels

Class ChannelController

GET /channels?condition=&include=

Display a listing of the resource.
GET/channels{?condition,include}

URI Parameters
HideShow
condition
integer (optional) 

Condition ID

include
string (optional) 

Relations to include

Choices: challenge questions


GET /channels/id?include=

Display the specified resource.
GET/channels/{id}{?include}

URI Parameters
HideShow
id
integer (required) 

ID of Channel

include
string (optional) 

Relations to include

Choices: challenge questions


Challenge Resources

Resources for Challenges. i.e. Student work, external resources

GET /resources

Display a listing of the resource.
GET/resources


POST /resources
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "name": "Test",
  "url": "http://test.com",
  "description": "Test description",
  "type": "PDF",
  "challenge_id": 1
}
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "name": "Test",
    "url": "http://test.com",
    "description": "Test description",
    "type": "PDF",
    "phase": 2,
    "challenge_id": 1,
    "updated_at": "2017-05-31 06:33:25",
    "created_at": "2017-05-31 06:33:25",
    "id": 23
  }
}

Store a newly created resource in storage.
POST/resources


GET /resources/id?include=
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "name": "Test",
    "url": "http://test.com",
    "description": "Test description",
    "type": "PDF",
    "phase": 2,
    "challenge_id": 1,
    "updated_at": "2017-05-31 06:33:25",
    "created_at": "2017-05-31 06:33:25",
    "id": 23
  }
}

Display the specified resource.
GET/resources/{id}{?include}

URI Parameters
HideShow
id
integer (required) 

ID of Resource

include
string (optional) 

Relations to include

Choices: challenge


PUT /resources/id
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "name": "Test",
  "url": "http://test.com",
  "description": "Test description",
  "type": "PDF",
  "challenge_id": 1
}
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "name": "Test",
    "url": "http://test.com",
    "description": "Test description",
    "type": "PDF",
    "phase": 2,
    "challenge_id": 1,
    "updated_at": "2017-05-31 06:33:25",
    "created_at": "2017-05-31 06:33:25",
    "id": 23
  }
}

Update the specified resource in storage.
PUT/resources/{id}

URI Parameters
HideShow
id
integer (required) 

ID of Resource


DELETE /resources/id
Responses204
Headers
Content-Type: application/json

Remove the specified resource from storage.
DELETE/resources/{id}

URI Parameters
HideShow
id
integer (required) 

ID of Resource


Categories

Categories of Microchallenges

GET /categories?include=

List categories.
GET/categories{?include}

Option to include challenges as well as resources. Resources default to current phase only.

URI Parameters
HideShow
include
string (optional) 

Relations to include

Choices: challenges challenges.questions{?:allPhases(true)}


POST /categories
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "name": "Name",
  "description": "Category description"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 1,
    "name": "Name",
    "description": "Category description",
    "created_at": "2017-05-31 07:35:50",
    "updated_at": "2017-05-31 07:35:50"
  }
}

Store a newly created resource in storage.
POST/categories


GET /categories/id?include=
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 1,
    "name": "Explicabo doloribus distinctio nulla.",
    "description": "Quas ad officia alias asperiores laborum hic aut ex.",
    "created_at": "2017-05-31 07:35:50",
    "updated_at": "2017-05-31 07:35:50"
  }
}

Get Category by ID.
GET/categories/{id}{?include}

Option to include challenges as well as resources. Resources default to current phase only.

URI Parameters
HideShow
id
integer (required) 

ID of Category

include
string (optional) 

Relations to include

Choices: challenges challenges.questions


POST /categories/id
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "name": "Name"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 1,
    "name": "Name",
    "description": "Quas ad officia alias asperiores laborum hic aut ex.",
    "created_at": "2017-05-31 07:35:50",
    "updated_at": "2017-05-31 07:35:50"
  }
}

Update the specified resource in storage.
POST/categories/{id}

URI Parameters
HideShow
id
integer (required) 

ID of Category


DELETE /categories/id
Responses204
Headers
Content-Type: application/json

Delete category. Any challenges within the category will have its category set to NULL.
DELETE/categories/{id}

URI Parameters
HideShow
id
integer (required) 

ID of Category


Discussion Questions

Discussion Questions

GET /questions?challenge=&phase=&include=
Responses200
Headers
Content-Type: application/json

Display a listing of the resource.
GET/questions{?challenge,phase,include}

URI Parameters
HideShow
challenge
number (optional) 

Get insights from challenge ID.

phase
number (optional) 

Get insights from specific phase

include
string (optional) 

Relations to include

Choices: insights challenge


POST /questions
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "text": "What?",
  "challenge_id": 1
}
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 1,
    "text": "What?",
    "challenge_id": 1,
    "phase": 1,
    "created_at": "2017-05-31 17:00:27",
    "updated_at": "2017-05-31 17:18:28"
  }
}

Store a newly created resource in storage.
POST/questions


GET /questions/id?include=
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 1,
    "text": "What?",
    "challenge_id": 1,
    "phase": 1,
    "created_at": "2017-05-31 17:00:27",
    "updated_at": "2017-05-31 17:18:28"
  }
}

Display the specified resource.
GET/questions/{id}{?include}

URI Parameters
HideShow
id
integer (required) 

ID of Question

include
string (optional) 

Relations to include

Choices: insights challenge


PUT /questions/id
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "text": "What?"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 1,
    "text": "What?",
    "challenge_id": 1,
    "phase": 1,
    "created_at": "2017-05-31 17:00:27",
    "updated_at": "2017-05-31 17:18:28"
  }
}

Update the specified resource in storage.
PUT/questions/{id}

URI Parameters
HideShow
id
integer (required) 

ID of Question


DELETE /questions/id
Responses204
Headers
Content-Type: application/json

Remove the specified resource from storage.
DELETE/questions/{id}

URI Parameters
HideShow
id
integer (required) 

ID of Question


Insights

Insights i.e. Discussion, comments, prototypes, ideas

GET /insights?types=&challenge=&phase=&include=
Responses200
Headers
Content-Type: application/json

Display a listing of the resource.
GET/insights{?types,challenge,phase,include}

URI Parameters
HideShow
types
array|number (optional) 

Filter by type (0 = NORMAL, 1 = CURATED, 2 = HIGHLIGHT)

challenge
number (optional) 

Get insights from challenge ID.

phase
number (optional) 

Get insights from specific phase

include
string (optional) 

Relations to include

Choices: user question challenge


POST /insights
Requestsexample 1example 2
Headers
Content-Type: application/json
Body
{
  "text": "Eos ipsa possimus nemo voluptas facilis in.",
  "user_id": 1,
  "timestamp": "1999-01-31 00:00:00",
  "thumbnail": "http://lorempixel.com/640/480/?44834",
  "type": 0,
  "question_id": 1,
  "challenge_id": 1,
  "slack_meta": {
    "var1": "content"
  }
}
Responses200204
Headers
Content-Type: application/json
Body
{
  "data": {
    "text": "Eos ipsa possimus nemo voluptas facilis in.",
    "user_id": 1,
    "timestamp": "1999-01-31 00:00:00",
    "thumbnail": "http://lorempixel.com/640/480/?44834",
    "type": 0,
    "question_id": 1,
    "challenge_id": 1,
    "slack_meta": "",
    "phase": 0,
    "updated_at": "2017-05-31 19:58:08",
    "created_at": "2017-05-31 19:58:08",
    "id": 1261
  }
}
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Body
{
  "insights": []
}
Responses200204
Headers
Content-Type: application/json
Body
{
  "data": {
    "text": "Eos ipsa possimus nemo voluptas facilis in.",
    "user_id": 1,
    "timestamp": "1999-01-31 00:00:00",
    "thumbnail": "http://lorempixel.com/640/480/?44834",
    "type": 0,
    "question_id": 1,
    "challenge_id": 1,
    "slack_meta": "",
    "phase": 0,
    "updated_at": "2017-05-31 19:58:08",
    "created_at": "2017-05-31 19:58:08",
    "id": 1261
  }
}
Headers
Content-Type: application/json

Store a newly created resource in storage.
POST/insights


GET /insights/id?include=
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "text": "Eos ipsa possimus nemo voluptas facilis in.",
    "user_id": 1,
    "timestamp": "1999-01-31 00:00:00",
    "thumbnail": "http://lorempixel.com/640/480/?44834",
    "type": 0,
    "question_id": 1,
    "challenge_id": 1,
    "slack_meta": "",
    "phase": 0,
    "updated_at": "2017-05-31 19:58:08",
    "created_at": "2017-05-31 19:58:08",
    "id": 1261
  }
}

Display the specified resource.
GET/insights/{id}{?include}

URI Parameters
HideShow
id
integer (required) 

ID of Insight

include
string (optional) 

Relations to include

Choices: user question challenge


PUT /insights/id
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "type": 1
}
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "text": "Eos ipsa possimus nemo voluptas facilis in.",
    "user_id": 1,
    "timestamp": "1999-01-31 00:00:00",
    "thumbnail": "http://lorempixel.com/640/480/?44834",
    "type": 1,
    "question_id": 1,
    "challenge_id": 1,
    "slack_meta": "",
    "phase": 0,
    "updated_at": "2017-05-31 19:58:08",
    "created_at": "2017-05-31 19:58:08",
    "id": 1261
  }
}

Update the specified resource in storage.
PUT/insights/{id}

URI Parameters
HideShow
id
integer (required) 

ID of Insight


DELETE /insights/id
Responses204
Headers
Content-Type: application/json

Remove the specified resource from storage.
DELETE/insights/{id}

URI Parameters
HideShow
id
integer (required) 

ID of Insight


Events

Events

GET /events
Responses200
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "id": 1,
      "name": "Name",
      "date": "2018-12-03 11:33:37",
      "description": "Desc."
    },
    {
      "id": 2,
      "name": "Name",
      "date": "2018-12-03 11:33:37",
      "description": "Desc."
    }
  ]
}

Display a listing of the resource.
GET/events


GET /events/id
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 1,
    "name”:”Event Name”,”date": "2018-12-03 11:33:37",
    "description”:”Description,”created_at": "2017-06-13 16:35:34",
    "updated_at": "2017-06-13 16:35:34"
  }
}

Display the specified resource.
GET/events/{id}

URI Parameters
HideShow
id
integer (required) 

ID of Challenge


Users

Users

GET /users
Responses200
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "id": 1,
      "slack_id": "UrH6vj8",
      "name": "Wilma Hickle",
      "email": "kallie68@example.org",
      "thumbnail": null,
      "admin": 0,
      "created_at": "2017-06-13 17:57:56",
      "updated_at": "2017-06-13 17:57:56"
    }
  ]
}

Display a listing of the resource.
GET/users


GET /users/id
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 1,
    "slack_id": "UuwXqgS",
    "name": "Lambert Feest",
    "email": "uwintheiser@example.com",
    "thumbnail": null,
    "admin": 0,
    "survey": "",
    "created_at": "2017-06-19 20:06:49",
    "updated_at": "2017-06-19 20:13:45"
  }
}

Display the specified resource.
GET/users/{id}

URI Parameters
HideShow
id
integer|string (required) 

ID of User OR Slack ID of user

include
string (optional) 

Relations to include

Choices: challenge


PUT /users/id
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "survey": ""
}
Responses200
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 1,
    "slack_id": "UuwXqgS",
    "name": "Lambert Feest",
    "email": "uwintheiser@example.com",
    "thumbnail": null,
    "admin": 0,
    "survey": "",
    "created_at": "2017-06-19 20:06:49",
    "updated_at": "2017-06-19 20:13:45"
  }
}

Update the specified resource in storage.
PUT/users/{id}

URI Parameters
HideShow
id
integer|string (required) 

ID of User OR Slack ID of user


Generated by aglio on 30 Jun 2017