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

Happy Path: Endpoint #2 Get Learning Resources for a Country - GET /api/v1/learning_resources?country=#{country} #4

Open
ajpulzone opened this issue Jan 17, 2023 · 1 comment
Assignees
Labels
good first issue Good for newcomers

Comments

@ajpulzone
Copy link
Owner

Get Learning Resources for a Particular Country

Request:

GET /api/v1/learning_resources?country=laos
Content-Type: application/json
Accept: application/json

Response:

The response data should contain exactly these elements and nothing more:

  • a data attribute, under which all other attributes are present:
  • id, always set to null
  • type, set to “learning_resource”
  • attributes, under which the following is present:
  • country name
  • video, an object containing:
  • title of video
  • video id from youtube
  • images, a collection holding elements that have information about that image, for example:
  • alternative description (for alt tags)
  • url for image

Example Response:

{
    "data": {
        "id": null,
        "type": "learning_resource",
        "attributes": {
            "country": "laos",
            "video": {
                "title": "A Super Quick History of Laos",
                "youtube_video_id": "uw8hjVqxMXw"
            },
            "images": [
                {
                    "alt_tag": "standing statue and temples landmark during daytime",
                    "url": "https://images.unsplash.com/photo-1528181304800-259b08848526?ixid=MnwzNzg2NzV8MHwxfHNlYXJjaHwxfHx0aGFpbGFuZHxlbnwwfHx8fDE2Njc4Njk1NTA&ixlib=rb-4.0.3"
                },
                {
                    "alt_tag": "five brown wooden boats",
                    "url": "https://images.unsplash.com/photo-1552465011-b4e21bf6e79a?ixid=MnwzNzg2NzV8MHwxfHNlYXJjaHwyfHx0aGFpbGFuZHxlbnwwfHx8fDE2Njc4Njk1NTA&ixlib=rb-4.0.3"
                },
                {
                    "alt_tag": "orange temples during daytime",
                    "url": "https://images.unsplash.com/photo-1563492065599-3520f775eeed?ixid=MnwzNzg2NzV8MHwxfHNlYXJjaHwzfHx0aGFpbGFuZHxlbnwwfHx8fDE2Njc4Njk1NTA&ixlib=rb-4.0.3"
                },
                {...},
                {...},
                {...},
                {etc},
              ]
        }
    }
}

Front End WireFrame:

Image

@ajpulzone ajpulzone self-assigned this Jan 17, 2023
@ajpulzone ajpulzone converted this from a draft issue Jan 17, 2023
@ajpulzone ajpulzone added the good first issue Good for newcomers label Jan 17, 2023
@ajpulzone
Copy link
Owner Author

1/16/23 6:54pm

Working in postman, but testing is HIGHLY inadequate.

However, response in postman is what we expect. AJP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Development

No branches or pull requests

1 participant