Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 172 additions & 1 deletion apiary.apib
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,178 @@ API endpoints that Operation Code's Rails backend makes available to its React f
errors: "Some error message"
}

## Request | Request a Mentor [/api/v1/requests{?id,user_id,details,language,service_id,requested_mentor_id,status,assigned_mentor_id}]
+ Parameters

+ id (integer, required) - Identification of mentor request in the form of an integer
+ user_id (integer, required) - ID of the user requesting a mentor, the passed in user must be a verified military veteran( i.e. user.verified == true)
+ details (string, optional) - Details of the mentor request in the form of a string
+ language (string, optional) - Primary language of the requesting mentee in the form of a string
+ service_id (integer, optional) - Indentification of the mentorship request in the form of an integer
+ requested_mentor_id (integer, optional) - Requested mentor's id in the form of an integer
+ status (string, optional) - Current fullfillment status in the form on a string
+ assigned_mentor_id (integer, optional) - Assigned mentor'd id in the form of an integer


### Create a New Mentor Request [POST]
+ Request (application/json)

+ Headers

Authorization: Bearer Access-Token

+ Body

{
"id": 2130,
"user_id": 4600,
"details": "I want to type well",
"language": "English",
"service_id": 200,
"requested_mentor_id": 250,
"status": "Open",
"assigned_mentor_id": 250
}

+ Response 201 (application/json)

+ Body

{
"id": 2130,
"user_id": 4600,
"details": "I want to type well",
"language": "English",
"service_id": 200,
"requested_mentor_id": 250,
"status": "Open",
"assigned_mentor_id": 250
}

+ Response 401 (application/json)

## Request | Show a Mentor Request [/api/v1/requests/{id}]
+ Parameters

+ id (integer, required) - Identification of mentor request in the form of an integer


### Show an Exiting Request From User ID [GET]

+ Request (application/json)

+ Headers

Authorization: Bearer Access-Token

+ Response 200 (application/json)

+ Body

{
"id": 1234,
"user_id": 5200,
"details": "I want to program",
"language": "English",
"service_id": 210,
"requested_mentor_id": 260,
"status": "Closed",
"assigned_mentor_id": 260
}

## Request | Collection [/api/v1/requests]

### Get All Unclaimed Mentor Requests [GET]
+ Request (application/json)

+ Headers

Authorization: Bearer Access-Token

+ Response 200 (application/json)

[
{
"id": 251,
"service_id": 223,
"language": "English",
"details": "I want to stop eating crayons",
"user_id": 1113,
"assigned_mentor_id": null,
"requested_mentor_id": 3333,
"created_at": "2017-09-26T06:54:58.607Z",
"updated_at": "2017-09-26T06:54:58.607Z",
"status": "open"
},
{ "id":"264"
"service_id": 243,
"language": "American Sign Language",
"details": "I need help interviewing",
"user_id": 2500,
"assigned_mentor_id": null,
"requested_mentor_id": 1250,
"created_at": "2017-09-26T06:54:58.607Z",
"updated_at": "2017-09-26T06:54:58.607Z",
"status": "open"
}
]

+ Response 401 (application/json)

{
error: 'Unauthorized'
}

## Request | Update [/api/v1/requests/{?user_id,id,details,language,service_id,requested_mentor_id,status,assigned_mentor_id}]
+ Parameters

+ user_id (integer, required) - Identification of the User requesting a mentor in the form of an integer
+ id (integer, required) - Identification of the Mentor Request in the form on an integer
+ details (string, optional) - Details of the mentor request in the form of a string
+ language (string, optional) - Primary language of the requesting mentee in the form of a string
+ service_id (integer, optional) - Indentification of the mentorship request in the form of an integer
+ requested_mentor_id (integer, optional) - Requested mentor's id in the form of an integer
+ status (string, optional) - Current fullfillment status in the form on a string
+ assigned_mentor_id (integer, optional) - Assigned mentor'd id in the form of an integer

### Update an Existing Mentor Request [PATCH]

+ Request (application/json)

+ Headers

Authorization: Bearer Access-Token

+ Body

{
"user_id": 5200,
"id": 4521,
"details": "I want to program",
"language": "English",
"service_id": 210,
"requested_mentor_id": 260,
"status": "Closed",
"assigned_mentor_id": 260
}

+ Response 200 (application/json)

+ Body

{
"user_id": 5200,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The id: will be included for the record

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I included the value, but I think because I did "id" and not "id:" github isn't registering correctly?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, force of (Ruby) habit. In this API documentation it is "id".

"id":4521,
"details": "I want to program",
"language": "English",
"service_id": 210,
"requested_mentor_id": 260,
"status": "Closed",
"assigned_mentor_id": 260
}

+ Response 400 (application/json)

## Resource [/api/v1/resources/{resource_id}]

+ Parameters
Expand Down Expand Up @@ -929,7 +1101,6 @@ API endpoints that Operation Code's Rails backend makes available to its React f

Authorization: Bearer Access-Token


+ Body

{
Expand Down