Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4. Get One Vendor #4

Closed
JorjaF opened this issue Aug 28, 2023 · 0 comments
Closed

4. Get One Vendor #4

JorjaF opened this issue Aug 28, 2023 · 0 comments

Comments

@JorjaF
Copy link
Owner

JorjaF commented Aug 28, 2023

Details
This endpoint should follow the pattern of GET /api/v0/vendors/:id
If a valid vendor id is passed in, a JSON object is sent back with a top-level data key that points to the vendor resource with that id, and all attributes for that vendor.
If an invalid vendor id is passed in, a 404 status as well as a descriptive error message should be sent back in the response.

Example #1 😁
Request:

GET /api/v0/vendors/55297
Content-Type: application/json
Accept: application/json
Response: status: 200

{
"data": {
"id": "55297",
"type": "vendor",
"attributes": {
"name": "Orange County Olive Oil",
"description": "Handcrafted olive oil made from locally grown olives",
"contact_name": "Syble Hamill",
"contact_phone": "1-276-593-3530",
"credit_accepted": false
}
}
}

Request:

 GET /api/v0/vendors/123123123123 (where `123123123123` is an invalid Vendor id)
 Content-Type: application/json
 Accept: application/json

Response: status: 404

{
"errors": [
{
"detail": "Couldn't find Vendor with 'id'=123123123123"
}
]
}

@JorjaF JorjaF changed the title Get One Vendor 4. Get One Vendor Aug 28, 2023
@JorjaF JorjaF closed this as completed Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant