John Hash
Pet Boarding API
CS 493: Cloud Application Development
Spring 2020
Oregon State University
Last Update: June 7, 2020. 12:00 pm Pacific
Base URL for all API endpoints https://hashj-project.wl.r.appspot.com
URL for account creation/login https://hashj-project.wl.r.appspot.com/account
405 and 406 Status Codes: Methods and Media Types Not Allowed
Page | Change | Date |
---|
| | Initial version. | May 27, 2020 | | | Version submitted | June 7, 2020 |
These properties cannot be set by the user. They are either automatically generated by the Google Datastore or derived from the user's Google Account.
Property | Type | Valid Values | Description | Required? |
---|---|---|---|---|
id | String | Arabic numerals 0-9, 16 in length | Generated by Google Datastore upon creation of user. | Yes |
user_id | String | Arabic numerals 0-9, less than 23 in length | Generated from the JSON Web Token 'sub' field upon creation of a new account when user is authenticated through Google OAuth 2.0 API. | Yes |
First | String | English letters, a-z or A-Z, less than 20 in length | First name of user. Name is fetched from Google People API upon creation of new account when user is authenticated through Google OAuth 2.0 API. | Yes |
Last | Number | English letters, a-z or A-Z, less than 20 in length | Last name of user. Name is fetched from Google People API upon creation of new account when user is authenticated through Google OAuth 2.0 API. | Yes |
The first three properties listed are the inherent properties to a Pet Entity. These are the properties under control when creating or updating a Pet Entity. Pet Entities can be created or updated without specifying values for these properties, but they really should be given values otherwise their value will be null.
Property | Type | Valid Values | Description | Required? |
---|---|---|---|---|
species | String | English letters and spaces, a-z or A-Z, less than 20 in length | The kind of animal that the pet is. | Not enforced, but strongly recommended |
color | String | English letters and spaces, a-z or A-Z, less than 20 in length | The color of the animal that is used for identification purposes. | Not enforced, but strongly recommended |
name | String | English letters and spaces, a-z or A-Z, less than 20 in length | What the pet is called by the owner. | Not enforced, but strongly recommended |
The next three properties listed are automatically created when the Pet Entity is created.
Property | Type | Valid Values | Description | Required? |
---|---|---|---|---|
owner (relationship) | String | Arabic numerals 0-9, less than 23 in length | The user_id of the pet's owner | Yes |
room (relationship) | Object | JSON object attributes-begins empty on creation-once pet is assigned to room, "id" of room and "name" of room are stored in the object | Description of the room that the pet is currently in. | Yes |
id | String | Arabic numerals 0-9, 16 in length | Generated by Google Datastore upon creation of user. | Yes |
The first four properties listed are the inherent properties to a Room Entity. These are the properties under control when creating or updating a Room Entity. Room Entities can be created or updated without specifying values for these properties, but they really should be given values otherwise their value will be null.
Name | Type | Valid Values | Description | Required? |
---|---|---|---|---|
type | String | English letters and spaces, a-z or A-Z, less than 20 in length | The kind of room. | Not enforced, but strongly recommended |
name | String | English letters and spaces, a-z or A-Z, less than 20 in length | What the room is called. | Not enforced, but strongly recommended |
size | Number | Arabic numerals 0-9, up to 999 | The area of the room in square feet. | Not enforced, but strongly recommended |
rate | Number (decimal) | Arabic numerals 0-9 and radix, up to 99.99 | The price of the room per night | Not enforced, but strongly recommended |
The next two properties listed are automatically created when a Room Entity is created.
Property | Type | Valid Values | Description | Required? |
---|---|---|---|---|
id | String | Arabic numerals 0-9, 16 in length | Generated by Google Datastore upon creation of user. | Yes |
occupants (relationship) | Array | Array populated with JSON objects-begins empty on creation-once pet is assigned to room, "id" of pet and "name" of of are stored an object in the array | Description of the room that the pet is currently in. | Yes |
Figure 1 shows a simple ERD that summaries the relationships among the three entities.
Users can own 0 to many pets. Pets can have only one owner.
Pets can reside in 0 or only one room. A room can hold 0 to many pets.
Figure 1. ERD showing entities, their properties, and relationships.
-
Pets are protected and can only be created, read, updated, or deleted by their authenticated owner.
-
Rooms are unprotected. They can be created, read, updated, or deleted by non-authenticated users.
-
Rooms can only be deleted if no pets are in them.
-
Pets can only reside in rooms with pets of the same owner, and the number of pets placed in the same room is not limited.
-
Relationship properties cannot be changed through PATCH and PUT update operations on room in order to protect the pet relationships.
Details for all the valid endpoints for the Pet Boarding API are listed below.
List all the current user accounts.
GET /users |
---|
None
None
"Accept" header value must be 'application/json'
JSON
Outcome | Status Code | Notes |
---|---|---|
Success | 200 OK |
|
- An attribute for self is automatically created in the response for each registered user.
| Status: 200 OK
[{"user_id": "114614630321977629406","First": "Christa","Last": "Hash","id": "5117579211309056","self": "https://localhost:8080/5117579211309056"},{"user_id": "114791681322698322383","First": "John M","Last": "Hash","id": "5631671361601536","self": "https://localhost:8080/5631671361601536"}] |
---|
Allows for creation of a new room entity.
POST /rooms |
---|
None
Required
None
"Accept" header value must be 'application/json'
JSON
Name | Type | Description | Required? |
---|---|---|---|
type | String | The kind of room. | Yes |
name | String | What the room is called. | Yes |
size | Number | The area of the room in square feet. | Yes |
rate | Number | The price of the room per night. | Yes |
{"type": "Standard Suite","name": "Bay View","size": 48, "rate": 39.99} |
---|
Success: 'application/json'
Outcome | Status Code | Notes |
---|---|---|
Success | 201 Created |
|
- Datastore will automatically generate an ID and store it with the room being created.
- The self attribute will contain the live link to the REST resource corresponding to this room. The self attribute is not stored in Datastore but is generated for the response only.
- A newly created room entity will contain a occupants attribute with a single empty array.
| Status: 201 Created
{"id": "abc123","name": "Bay View","type": "Standard Suite", "rate": 39.99,"size": 48,"occupants":[],"self": "https://base-url/rooms/abc123"} |
---|
Allows for retrieving a record for a single existing room.
GET /rooms/:room_id |
---|
Name | Type | Description | Required? |
---|---|---|---|
room_id | String | ID of the room | Yes |
None
"Accept" header value must be 'application/json'
Success: JSON
Failure: JSON
Outcome | Status Code | Notes |
---|---|---|
Success | 200 OK |
| | Failure | 404 Not Found | No room with this room_id exists |
- An attribute for self is automatically created in the response for both the boat and each of the loads currently assigned to the room.
| Status: 200 OKExample of a room returned with no occupants yet assigned{"id": "abc123","name": "Bay View","type": "Standard Suite", "rate": 39.99,"size": 48,"occupants":[],"self": "https://base-url/rooms/abc123"}Example of a room returned with two occupants currently assigned{"id": "abc123","name": "Bay View","type": "Standard Suite", "rate": 39.99,"size": 48,"occupants":[{"id": "5701666712059904","self": "http://localhost:8080/loads/5701666712059904"},{"id": "6278060542263296","self": "http://localhost:8080/loads/6278060542263296"}], "self": "https://base-url/rooms/abc123"} | | --- |
| Status: 404 Not Found
{ "Error": "No room with this room_id exists" } |
---|
List all the rooms currently in the datastore and their attributes.
GET /rooms |
---|
None
None
"Accept" header value must be 'application/json'
JSON
Outcome | Status Code | Notes |
---|---|---|
Success | 200 OK |
|
- An attribute for self is automatically created in the response for both the room and each of the occupants currently assigned to the room.
- The results for rooms are paginated with a limit of 5 records per page. A next attribute is generated with a link to the next set of rooms results in sequential order.
- Attribute total rooms lists the total number of rooms in the collection
- A GET request with the next link provided returns the next set of room results.
| Status: 200 OK
{"rooms": [{"name": "Harbor View","rate": 25.5,"size": 49,"type": "Standard Suite","occupants": [],"id": "5079418695319552","self": "https://localhost:8080/rooms/5079418695319552"},{"name": "Peaceful Meadows","rate": 49.99,"size": 75,"type": "Luxury Suite","occupants": [],"id": "5636645067948032","self": "https://localhost:8080/rooms/5636645067948032"},{"size": 88,"type": "Presidential Suite","occupants": [],"name": "Grand View","rate": 79.99,"id": "5646488461901824","self": "https://localhost:8080/rooms/5646488461901824"},{"size": 48,"type": "Standard Suite","occupants": [],"name": "Bay View","rate": 29.99,"id": "5706627130851328","self": "https://localhost:8080/rooms/5706627130851328"},{"occupants": [],"name": "Hallway View","rate": 19.99,"size": 20,"type": "Simple Suite","id": "5714489739575296","self": "https://localhost:8080/rooms/5714489739575296"}],"next": https://localhost:8080/rooms?cursor=CioSJGoPbX5oYXNoai1wcm9qZWN0chELEgRSb29tGICAgJjFqZMKDBgAIAA=, "total_rooms": 7} |
---|
Allows for updating a room's attributes with the HTTP Verb 'PATCH'
All JSON attributes of the room entity remain the same unless specifically specified in request body.
Caution: This route is not intended for managing pet-room assignments. Pet-room relationships can only be managed through: DELETE /room/:room_id/pets/:pet_id or PUT /room/:room_id/pets/:pet_id Only attributes inherit to the room entity will be affected.
PATCH /rooms/:room_id |
---|
Name | Type | Description | Required? |
---|---|---|---|
room_id | String | ID of the room | Yes |
Required
Name | Type | Description | Required? |
---|---|---|---|
type | String | The kind of room. | Optional |
name | String | What the room is called. | Optional |
size | Number | The area of the room in square feet. | Optional |
rate | Number | The price of the room per night | Optional |
Success: none
Failure: JSON
Location header has live URL to the updated resource.
Outcome | Status Code | Notes |
---|---|---|
Success | 204 No Content | Returns a 204 status code and URL to resource in the Location header. |
Failure | 404 Not Found | No room with this room_id exists. If room_id isn't found, 404 is returned. |
| Status: 404 Not Found
{ "Error": "No room with this room_id exists" } |
---|
Allows for updating a room's attributes with the HTTP Verb 'PUT'
All JSON attributes of the room will reflect those provided in JSON request body. Failing to provide values for attributes will be overwritten with 'null'. It is recommended that all attributes are provided.
Caution: This route not intended for managing pet-room assignments. Pet-room assignments can only be managed through: DELETE /room/:room_id/pets/:pet_id or PUT /room/:room_id/pets/:pet_id Only attributes inherit to the room entity will be affected.
PUT /rooms/:room_id |
---|
Name | Type | Description | Required? |
---|---|---|---|
room_id | String | ID of the room | Yes |
Required
Name | Type | Description | Required? |
---|---|---|---|
type | String | The kind of room. | Optional |
name | String | What the room is called. | Optional |
size | Number | The area of the room in square feet. | Optional |
rate | Number | The price of the room per night | Optional |
No body
Success: No body
Failure: JSON
Outcome | Status Code | Notes |
---|---|---|
Success | 204 No Content | Returns a 204 status code and URL to resource in the Location header. |
Failure | 404 Not Found | No room with this room_id exists. If room_id isn't found, 404 is returned. |
Status: 204 No Content |
---|
| Status: 404 Not Found
{ "Error": "No room with this room_id exists" } |
---|
Allows for removing a room. Note that if the room currently has any occupants, the room cannot be deleted until all occupants are removed.
Note: To remove an an occupant, use: DELETE /room/:room_id/pets/:pet_id
DELETE /rooms/:room_id |
---|
Name | Type | Description | Required? |
---|---|---|---|
room_id | String | ID of the room | Yes |
None
No body
Success: No body
Failure: JSON
Outcome | Status Code | Notes |
---|---|---|
Success | 204 No Content |
| | Failure | 404 Not Found | No room with this room_id was found in the datastore | | Failure | 403 Forbidden | 403 is returned if the room has occupants, and therefore, cannot be deleted at this time. |
- Removal of the room from the datastore is allowed only if the room is empty
Status: 204 No Content |
---|
| Status: 404 Not Found
{ "Error": "No room with this room_id exists" } |
---|
| Status: 403 Forbidden
{ "Error": "Occupants of room must be removed before room can be deleted." } |
---|
Allows for creation of a new pet that is initially unassigned to a room.
POST /pets |
---|
None
Required
"Authorization" header required. Type "Bearer". Token format: JSON Web Token (JWT).
"Accept" header value must be 'application/json'
JSON
Name | Type | Description | Required? |
---|---|---|---|
species | String | The kind of animal. | Yes |
color | String | The color of the animal (e.g. "black and white" or "brown") | Yes |
name | String | What the pet is called by the owner. | Yes |
{"species": "Canine","color": "Red","name": "Cooper"} |
---|
Success: 'application/json'
Failure: 'application/json'
Outcome | Status Code | Notes |
---|---|---|
Success | 201 Created |
| | Failure | 401 Unauthorized | If the JSON Web Token (JWT) is not valid, the user cannot create a pet record.The user must return to:https://hashj-project.wl.r.appspot.com/accountto get a valid JWT by either creating an account or re-signing in. |
- Datastore will automatically generate an ID and store it with the entity being created. This value is sent in the response body as shown in the example. The room attribute is generated automatically and added the entity.
- The value of the attribute room begins as an empty object because the pet is not in a room initially. Later, room will be updated to hold identifying information about the room that the pet currently resides in.
- The value of the attribute self is a live link to the REST resource corresponding to this pet. In other words, this is the URL to get this newly created pet. This link is generated for the response and not stored in the datastore.
| Status: 201 Created
{ "species": "Canine", "color": "Red", "name": "Cooper", "room": {}, "owner": "114791681322698322383", "id": "5755374237908992", "self": "https://localhost:8080/pets/5755374237908992"} |
---|
| Status: 401 Unauthorized
{ "Error": "Invalid token signature"} |
---|
Allows for viewing information on an existing pet that is owned by the user.
GET /pets/:pet_id |
---|
Name | Type | Description | Required? |
---|---|---|---|
pet_id | String | ID of the pet | Yes |
None
"Authorization" header required. Type "Bearer". Token format: JSON Web Token (JWT).
"Accept" header value must be 'application/json'
Success: 'application/json'
Failure: 'application/json'
Outcome | Status Code | Notes |
---|---|---|
Success | 200 OK | Returns request pet information |
Failure | 404 Not Found | No pet with this pet_id exists |
Failure | 404 Not Found | No pets exist in data store |
Failure | 403 Forbidden | User has been authenticated, but the pet with the pet_id in the request doesn't belong to the user making the request. |
Failure | 401 Unauthorized | The JSON Web Token provided in the Authorization header of the request is invalid. User wasn't recognized by server. |
- If the pet is currently in a room, the name, id, and self URL for the room will appear in the room attribute in the response.
| Status: 200 OK
{ "id": "4693933435125760", "species": "Box turtle", "color": "Brown", "name": "Boxer", "room": { "name": "Bay View", "id": "6485250678980608", "self": "https://localhost:8080/rooms/6485250678980608" }, "owner": "114791681322698322383", "self": "https://localhost:8080/pets/4693933435125760"} |
---|
| Status: 404 Not Found
{ "Error": "No pet with this pet_id exists." } |
---|
| Status: 404 Not Found
{ "Error": "No pets in datastore." } |
---|
| Status: 403 Forbidden
{ "Error": "No authorization to access this pet!" } |
---|
| Status: 401 Unauthorized
{ "Error": "Invalid token signature." } |
---|
List all the current pets whether they are in a room or not.
GET /pets |
---|
None
None
"Authorization" header required. Type "Bearer". Token format: JSON Web Token (JWT).
"Accept" header value must be 'application/json'
JSON
Outcome | Status Code | Notes |
---|---|---|
Success | 200 OK |
|
- An attribute for self is automatically created in the response for both the pets and room they are assigned to if applicable.
- The results for pets are paginated with a limit of 5 records per page. A next attribute is generated with a link to the next set of pets results in sequential order.
- Attribute total_pets lists the total number of pets in the collection
- A GET request with the next link provided returns the next set of pets results.
| Status: 200 OK
{"pets": [{"name": "Rex","species": "Canine","color": "Black and tan","owner": "114791681322698322383","room": {},"id": "4887575659544576","self": "https://localhost:8080/pets/4887575659544576"},{"owner": "114791681322698322383","room": {},"name": "Dani","species": "Canine","color": "Black and tan","id": "5104074961715200","self": "https://localhost:8080/pets/5104074961715200"},{"owner": "114791681322698322383","room": {},"name": "Polly","species": "Parrot","color": "Gray","id": "5685335367352320","self": "https://localhost:8080/pets/5685335367352320"},{"name": "Tigger","species": "Feline","color": "Striped","owner": "114791681322698322383","room": {},"id": "5704642587525120","self": "https://localhost:8080/pets/5704642587525120"},{"name": "Boxer","species": "Box turtle","color": "Brown","owner": "114791681322698322383","room": {},"id": "5740073718906880","self": "https://localhost:8080/pets/5740073718906880"}],"next": "https://localhost:8080/pets?cursor=CikSI2oPbX5oYXNoai1wcm9qZWN0chALEgNQZXQYgICA%2BJCSmQoMGAAgAA%3D%3D","total\_pets": 7} |
---|
Allows for updating a pet's attributes with the HTTP Verb 'PATCH'
All JSON stored attributes of the pet entity remain the same unless specifically specified in request body.
Disclaimer: This route not intended for managing pet-room assignments. Pet-room assignments can only be managed through: DELETE /room/:room_id/pets/:pet_id or PUT /room/:room_id/pets/:pet_id Only attributes inherit to the pet entity will be affected.
PATCH /pets/:pet_id |
---|
Name | Type | Description | Required? |
---|---|---|---|
pet_id | String | ID of the pet | Yes |
"Authorization" header required. Type "Bearer". Token format: JSON Web Token (JWT).
JSON
Name | Type | Description | Required? |
---|---|---|---|
species | String | The kind of animal. | Optional |
color | String | The color of the animal (e.g. "black and white" or "brown") | Optional |
name | String | What the pet is called by the owner. | Optional |
No body
Location response header has live URL to the the updated resource
Success: No body
Failure: JSON
Outcome | Status Code | Notes |
---|---|---|
Success | 204 No Content | Location header has URL to the resource |
Failure | 404 Not Found | No pet with this pet_id exists for the user. Rather than having a 403 for the user if they are forbidden from accessing the pet, the 404 leaves it ambiguous as to whether they have stumbled upon another user's pet's id. This is used in other API's such as GitHub to further protect privacy. |
Failure | 401 Unauthorized | The JSON Web Token provided in the Authorization header of the request is invalid. User wasn't recognized by server. |
Status: 204 No Content |
---|
| Status: 404 Not Found
{ "Error": "User owns no pet with this pet_id" } |
---|
Status: 401 Unauthorized |
{ "Error": "Invalid token signature" } |
Allows for updating a pet's attributes with the HTTP Verb 'PUT'
All JSON attributes of the pet will reflect those provided in JSON request body. Failing to provide values for attributes will be overwritten with 'null'.
Disclaimer: This route not intended for managing pet-room assignments. Pet-room assignments can only be managed through: DELETE /room/:room_id/pets/:pet_id or PUT /room/:room_id/pets/:pet_id Only attributes inherit to the pet entity will be affected.
PUT /pets/:pet_id |
---|
Name | Type | Description | Required? |
---|---|---|---|
pet_id | String | ID of the pet | Yes |
"Authorization" header required. Type "Bearer". Token format: JSON Web Token (JWT).
JSON
Name | Type | Description | Required? |
---|---|---|---|
species | String | The kind of animal. | Optional |
color | String | The color of the animal (eg "black and white" or "brown") | Optional |
name | String | What the pet is called by the owner. | Optional |
No body
Location response header has live URL to the the updated resource
Success: No body
Failure: JSON
Outcome | Status Code | Notes |
---|---|---|
Success | 204 No Content | Location header has URL to the resource |
Failure | 404 Not Found | No pet with this pet_id exists for the user. Rather than having a 403 for the user if they are forbidden from accessing the pet, the 404 leaves it ambiguous as to whether they have stumbled upon another user's pet's id. This is used in other API's such as GitHub to further protect privacy. |
Failure | 401 Unauthorized | The JSON Web Token provided in the Authorization header of the request is invalid. User wasn't recognized by server. |
Status: 204 No Content |
---|
| Status: 404 Not Found
{ "Error": "User owns no pet with this pet_id" } |
---|
Status: 401 Unauthorized |
{ "Error": "Invalid token signature" } |
Allows for deleting a pet from the system. If the pet is currently in a room, the pet will be removed from that room.
DELETE /pets/:pet_id |
---|
Name | Type | Description | Required? |
---|---|---|---|
pet_id | String | ID of the pet | Yes |
None
"Authorization" header required. Type "Bearer". Token format: JSON Web Token (JWT).
No body
Success: No body
Failure: JSON
Outcome | Status Code | Notes |
---|---|---|
Success | 204 No Content |
| | Failure | 404 Not Found | If the pet is not found in the set of pets that the user owns or if the user tries delete a pet that they do not own, then the 404 error is produced. It is possible that a 403 could have been used for the later case, but the 404 seems appropriate because it is also a way to protect the privacy of the other user in not allowing the other users to know the id of pets that they do not own. It is also borderline an appropriate case because the combination of the user's id and pet id do not exist. |
- Removal of the pet from the datastore also updates the occupants attribute for the room that the pet was assigned to by removing pet's id from the array of occupants.
Status: 204 No Content |
---|
| Status: 404 Not Found
{ "Error": "No pet with this pet id exists for current user." } |
---|
An empty room or a room that has a pet in it that is owned by the user can have a new pet assigned to it.
PUT /rooms/:room_id/pets/:pet_id |
---|
Name | Type | Description | Required? |
---|---|---|---|
room_id | String | ID of the room | Yes |
pet_id | String | ID of the pet | Yes |
None
Note: Set Content-Length to 0 in your request when calling out to this endpoint.
No body
Authorization" header required. Type "Bearer". Token format: JSON Web Token (JWT).
Success: No body
Failure: JSON
Outcome | Status Code | Notes |
---|---|---|
Success | 204 No Content | Succeeds only if a room exists with this room_id, a pet with the specified pet_id exists, and the pet with that pet_id is not already assigned to another room. |
Failure | 403 Forbidden | This pet is already assigned to another room. |
Failure | 403 Forbidden | User does not have authorization to assign pet to room. |
Failure | 403 Forbidden | Another owner already has pets in that room. Pets from two different owners cannot be in the same room. |
Failure | 404 Not Found | No room with this room_id exists, and/or no pet with this pet_id exits. |
Failure | 401 Unauthorized | The user was not authenticated and not recognized by the server. |
Status: 204 No Content |
---|
| Status: 403 Forbidden
{ "Error": "The pet with this pet_id is already assigned to another room." } |
---|
Status: 403 Forbidden |
{ "Error": "You lack authorization for this request." } |
| | Status: 403 Forbidden { "Error": "This room is in use by another pet owner. Pick another room number." } |
| Status: 404 Not Found
{ "Error": "The specified room and/or pet don't exist" } |
---|
| Status: 401 Unauthorized
{ "Error": "Invalid token signature." } |
---|
Notes: A pet can only be assigned to one room, but a room can hold an unlimited number of pets. Pets can only be in rooms with other pets that have the same owner.
A room that has a pet in it can be removed from the room by the pet's owner.
DELETE /rooms/:room_id/pets/:pet_id |
---|
Name | Type | Description | Required? |
---|---|---|---|
room_id | String | ID of the room | Yes |
pet_id | String | ID of the pet | Yes |
None
Note: Set Content-Length to 0 in your request when calling out to this endpoint.
No body
Authorization" header required. Type "Bearer". Token format: JSON Web Token (JWT).
Success: No body
Failure: JSON
Outcome | Status Code | Notes |
---|---|---|
Success | 204 No Content | Succeeds only if a room exists with this room_id and the specified pet owned by the user is in that room. |
Failure | 404 Not Found | No room with that room id exists. |
Failure | 404 Not Found | No pet with that pet_id exists under the current user's ownership. Again, a 404 here protects the pet_id leaving it ambiguous as to whether a pet with that id exists. The actual owner would know it does. A 403 would let a non-owner know a pet's id number and what room it is in. |
Failure | 401 Unauthorized | The user was not authenticated and not recognized by the server. |
Status: 204 No Content |
---|
| Status: 404 Not Found
{ "Error": "The specified room does not exist." } |
---|
Status: 404 Not Found |
{ "Error": "The specified pet is not in that room." } |
| Status: 401 Unauthorized
{ "Error": "Invalid token signature." } |
---|
The following endpoints are not allowed and will return a 405 status code:
DELETE /rooms
PUT /rooms
PATCH /rooms
DELETE /pets
PUT/pets
PATCH /pets
| Status: 405 Method Not Allowed
{ "Error": "Method not allowed." } |
---|
Endpoints that return full response bodies and either a 200 status code or a 201 status code require that the content is returned in 'application/json' format. The 'accept' header in the request must specify that 'application/json' is accepted.
The following endpoints will return a 406 status code if 'accept' header is properly set:
POST /rooms
GET /rooms
GET /rooms/:room_id
POST /pets
GET /pets
GET /pets/:pet_id
GET /users
| Status: 406 Not Acceptable
{ "Error": "Only application/json is acceptable." } |
---|