Hack 24 API documentation version 2016年02月19日

https://api.hack24.co.uk

Teams Resource

Allows creating and modifying teams and team members

get
post

get /teams

HTTP status code 200

Body

Type: application/vnd.api+json

Example:

{
 "links": {
 "self": "/teams/refactor-tractor"
 },
 "data": {
 "type": "teams",
 "id": "refactor-tractor",
 "attributes": {
 "name": "Refactor Tractor"
 },
 "relationships": {
 "members": {
 "links": {
 "self": "/teams/refactor-tractor/members"
 },
 "data": [
 { "type": "users", "id": "barry", "meta": { "joined": "2016-01-23T12:00:00.0000000Z" } },
 { "type": "users", "id": "mary", "meta": { "joined": "2016-01-21T12:00:00.0000000Z" } }
 ]
 }
 }
 }
}

post /teams

Body

Type: application/vnd.api+json

Example:

{
 "data": {
 "type": "teams",
 "attributes": {
 "name": "Refactor Tractor"
 },
 "relationships": {
 "members": {
 "data": [
 { "type": "users", "id": "barry" },
 { "type": "users", "id": "mary" }
 ]
 }
 }
 }
}

HTTP status code 201

Body

Type: application/vnd.api+json

Example:

{
 "links": {
 "self": "/teams/refactor-tractor"
 },
 "data": {
 "type": "teams",
 "id": "refactor-tractor",
 "attributes": {
 "name": "Refactor Tractor"
 },
 "relationships": {
 "members": {
 "links": {
 "self": "/teams/refactor-tractor/members"
 },
 "data": [
 { "type": "users", "id": "barry", "meta": { "joined": "2016-01-23T12:00:00.0000000Z" } },
 { "type": "users", "id": "mary", "meta": { "joined": "2016-01-21T12:00:00.0000000Z" } }
 ]
 }
 }
 }
}

Returns a specific team.

get

get /teams/{teamId}

URI Parameters

  • Team ID: required (string)

HTTP status code 200

Body

Type: application/vnd.api+json

Example:

{
 "links": {
 "self": "/teams/refactor-tractor"
 },
 "data": {
 "type": "teams",
 "id": "refactor-tractor",
 "attributes": {
 "name": "Refactor Tractor"
 },
 "relationships": {
 "members": {
 "links": {
 "self": "/teams/refactor-tractor/members"
 },
 "data": [
 { "type": "users", "id": "barry", "meta": { "joined": "2016-01-23T12:00:00.0000000Z" } },
 { "type": "users", "id": "mary", "meta": { "joined": "2016-01-21T12:00:00.0000000Z" } }
 ]
 }
 }
 },
 "included": [{
 "type": "users",
 "id": "barry",
 "attributes": {
 "name": "Barry"
 },
 "links": {
 "self": "/users/barry"
 }
 },{
 "type": "users",
 "id": "mary",
 "attributes": {
 "name": "Mary"
 },
 "links": {
 "self": "/users/mary"
 }
 }]
}

Manages team members for the current team.

get
post
patch
delete

get /teams/{teamId}/members

URI Parameters

  • Team ID: required (string)

HTTP status code 200

Body

Type: application/vnd.api+json

Example:

{
 "links": {
 "self": "/teams/refactor-tractor/members"
 },
 "data": [{
 "type": "users",
 "id": "barry",
 "meta": {
 "joined": "2016-01-45T12:00:00.0000000Z"
 }
 },{
 "type": "users",
 "id": "mary",
 "meta": {
 "joined": "2016-01-45T12:00:00.0000000Z"
 }
 }],
 "included": [{
 "links": {
 "self": "/users/barry"
 },
 "type": "users",
 "id": "barry",
 "attributes": {
 "name": "Barry"
 }
 },{
 "links": {
 "self": "/users/mary"
 },
 "type": "users",
 "id": "mary",
 "attributes": {
 "name": "Mary"
 }
 }]
}

post /teams/{teamId}/members

URI Parameters

  • Team ID: required (string)

Body

Type: application/vnd.api+json

Example:

{
 "data": [{
 "type": "users",
 "id": "zack"
 }]
}

HTTP status code 200

Body

Type: application/vnd.api+json

Example:

{
 "links": {
 "self": "/teams/refactor-tractor/members"
 },
 "data": [{
 "type": "users",
 "id": "barry",
 "meta": {
 "joined": "2016-01-23T12:00:00.0000000Z"
 }
 },{
 "type": "users",
 "id": "mary",
 "meta": {
 "joined": "2016-01-21T12:00:00.0000000Z"
 }
 },{
 "type": "users",
 "id": "zack",
 "meta": {
 "joined": "2016-01-31T12:00:00.0000000Z"
 }
 }],
 "included": [{
 "links": {
 "self": "/users/barry"
 },
 "type": "users",
 "id": "barry",
 "attributes": {
 "name": "Barry"
 }
 },{
 "links": {
 "self": "/users/mary"
 },
 "type": "users",
 "id": "mary",
 "attributes": {
 "name": "Mary"
 }
 },{
 "links": {
 "self": "/users/zack"
 },
 "type": "users",
 "id": "zack",
 "attributes": {
 "name": "Zack"
 }
 }]
}

patch /teams/{teamId}/members

URI Parameters

  • Team ID: required (string)

Body

Type: application/vnd.api+json

Example:

{
 "data": [{
 "type": "users",
 "id": "adam"
 }]
}

HTTP status code 200

Body

Type: application/vnd.api+json

Example:

{
 "links": {
 "self": "/teams/refactor-tractor/members"
 },
 "data": [{
 "type": "users",
 "id": "adam",
 "meta": {
 "joined": "2016-01-31T12:00:00.0000000Z"
 }
 }],
 "included": [{
 "links": {
 "self": "/users/adam"
 },
 "type": "users",
 "id": "adam",
 "attributes": {
 "name": "Adam"
 }
 }]
}

delete /teams/{teamId}/members

URI Parameters

  • Team ID: required (string)

Body

Type: application/vnd.api+json

Example:

{
 "data": [{
 "type": "users",
 "id": "mary"
 }]
}

HTTP status code 204

Users Resource

Allows creating and modifying users

get
post

get /users

HTTP status code 200

Body

Type: application/vnd.api+json

Example:

{
 "links": {
 "self": "/users"
 },
 "data": [{
 "links": {
 "self": "/users/adam"
 },
 "type": "users",
 "id": "adam",
 "attributes": {
 "name": "Adam"
 },
 "relationships": {
 "team": {
 "data": { "type": "teams", "id": "code-monkeys", "meta": { "joined": "2016-01-21T12:00:00.0000000Z" } }
 }
 }
 },{
 "links": {
 "self": "/users/barry"
 },
 "type": "users",
 "id": "barry",
 "attributes": {
 "name": "Barry"
 },
 "relationships": {
 "team": {
 "data": { "type": "teams", "id": "refactor-tractor", "meta": { "joined": "2016-01-23T12:00:00.0000000Z" } }
 }
 }
 },{
 "links": {
 "self": "/users/mary"
 },
 "type": "users",
 "id": "mary",
 "attributes": {
 "name": "Mary"
 },
 "relationships": {
 "team": {
 "data": { "type": "teams", "id": "refactor-tractor", "meta": { "joined": "2016-01-21T12:00:00.0000000Z" } }
 }
 }
 },{
 "links": {
 "self": "/users/zack"
 },
 "type": "users",
 "id": "zack",
 "attributes": {
 "name": "Zack"
 },
 "relationships": {
 "team": {
 "data": { "type": "teams", "id": "code-monkeys", "meta": { "joined": "2016-01-12T12:00:00.0000000Z" } }
 }
 }
 }],
 "included": [{
 "links": {
 "self": "/teams/refactor-tractor"
 },
 "type": "teams",
 "id": "refactor-tractor",
 "attributes": {
 "name": "Refactor Tractor"
 },
 "relationships": {
 "members": {
 "links": {
 "self": "/teams/refactor-tractor/members"
 },
 "data": [
 { "type": "users", "id": "barry", "meta": { "joined": "2016-01-23T12:00:00.0000000Z" } },
 { "type": "users", "id": "mary", "meta": { "joined": "2016-01-21T12:00:00.0000000Z" } }
 ]
 }
 }
 },{
 "links": {
 "self": "/teams/code-monkeys"
 },
 "type": "teams",
 "id": "code-monkeys",
 "attributes": {
 "name": "Code Monkeys"
 },
 "relationships": {
 "members": {
 "links": {
 "self": "/teams/refactor-tractor/members"
 },
 "data": [
 { "type": "users", "id": "adam", "meta": { "joined": "2016-01-21T12:00:00.0000000Z" } },
 { "type": "users", "id": "zack", "meta": { "joined": "2016-01-12T12:00:00.0000000Z" } }
 ]
 }
 }
 }]
}

post /users

Body

Type: application/vnd.api+json

Example:

{
 "data": {
 "type": "users",
 "attributes": {
 "name": "Steven"
 },
 "relationships": {
 "team": {
 "data": { "type": "teams", "id": "refactor-tractor" }
 }
 }
 }
}

HTTP status code 201

Body

Type: application/vnd.api+json

Example:

{
 "links": {
 "self": "/users/steven"
 },
 "data": {
 "type": "users",
 "id": "steven",
 "attributes": {
 "name": "Steven"
 },
 "relationships": {
 "team": {
 "data": { "type": "teams", "id": "refactor-tractor", "meta": { "joined": "2016-02-09T12:00:00.0000000Z" } }
 }
 }
 }
}

Returns a specific user.

get

get /users/{userId}

URI Parameters

  • userId: required (string)

HTTP status code 200

Body

Type: application/vnd.api+json

Example:

{
 "links": {
 "self": "/users/barry"
 },
 "data": {
 "type": "users",
 "id": "barry",
 "attributes": {
 "name": "Barry"
 },
 "relationships": {
 "team": {
 "data": { "type": "teams", "id": "refactor-tractor", "meta": { "joined": "2016-01-23T12:00:00.0000000Z" } }
 }
 }
 },
 "included": [{
 "type": "teams",
 "id": "refactor-tractor",
 "attributes": {
 "name": "Refactor Tractor"
 },
 "links": {
 "self": "/teams/refactor-tractor"
 },
 "relationships": {
 "members": {
 "links": {
 "self": "/teams/refactor-tractor/members"
 },
 "data": [
 { "type": "users", "id": "barry", "meta": { "joined": "2016-01-23T12:00:00.0000000Z" } },
 { "type": "users", "id": "mary", "meta": { "joined": "2016-01-21T12:00:00.0000000Z" } }
 ]
 }
 }
 },{
 "links": {
 "self": "/users/mary"
 },
 "type": "users",
 "id": "mary",
 "attributes": {
 "name": "Mary"
 },
 "relationships": {
 "team": {
 "data": { "type": "teams", "id": "refactor-tractor", "meta": { "joined": "2016-01-21T12:00:00.0000000Z" } }
 }
 }
 }]
}

Manages a user's team.

get
patch

get /users/{userId}/team

URI Parameters

  • userId: required (string)

HTTP status code 200

Body

Type: application/vnd.api+json

Example:

{
 "links": {
 "self": "/users/barry/team"
 },
 "data": {
 "type": "teams",
 "id": "refactor-tractor",
 "meta": {
 "joined": "2016-01-23T12:00:00.0000000Z"
 }
 },
 "included": [{
 "links": {
 "self": "/team/refactor-tractor"
 },
 "type": "teams",
 "id": "refactor-tractor",
 "attributes": {
 "name": "Refactor Tractor"
 }
 }]
}

patch /users/{userId}/team

URI Parameters

  • userId: required (string)

Body

Type: application/vnd.api+json

Example:

{
 "data": {
 "type": "teams",
 "id": "code-monkeys"
 }
}

HTTP status code 204