# Bosco Site Redesign API Requests ## Fix CORS error on news.thebosco.com :::info When I visit https://the-bosco-site.vercel.app/ And I submit my email in the footer Then I am signed up to The Bosco's newsletter But instead I get a CORS error ::: I haven't seen this news.thebosco.com subdomain before and so I'm not sure what it is actually pointing to. The URL it is posting to looks suspect, and likey it's pointing to a third-party service. But essentially, the email submit for, is POSTing to news.thebosco.com and receiving a CORS error. Any insight is appreciated. ![](https://i.imgur.com/VYa2rrj.png) ![](https://i.imgur.com/sB7Y9Bl.png) ## Support multiday events at `/v3/user-site/events` Events can be single day or multi-day. It looks like Justin created a *v3* endpoint for events that returns additional fields compared to the *v1* endpoint, e.g. `city`, `state`, and `productType`. However, it looks like the new *v3* endpoint doesn't support the `date` parameter that the *v1* endpoint does. ### Examples ``` # V1 Single Day $ curl -XGET 'https://api.thebos.co/v1/user-site/events?slug=spotifyfinallyrich' | jq '.result.event.product_type' > "" # V3 Single Day has the `product_type` field $ curl -XGET 'https://api.thebos.co/v3/user-site/events?slug=spotifyfinallyrich' | jq '.result.event.product_type' > "Social Photographer" # V1 Multi Day $ curl -XGET 'https://api.thebos.co/v1/user-site/events?slug=ebay-x-nike-sb-pop-up&date=2022-12-09' | jq '.result.event.product_type' > "" # V3 Multi Day (500s) $ curl -I -XGET 'https://api.thebos.co/v3/user-site/events?slug=ebay-x-nike-sb-pop-up&date=2022-12-09' > 500 ERROR ``` ## New endpoint to support Single Media Carousel On the old site (currenty live site), the page to view a single asset loads a single image (and its adjacent images at a time): https://www.thebosco.com/p/13694-IYXTCB. It uses the following endpoint, which returns a `photo`, `previousAsset`, and `nextAsset`. ``` # Example $ curl -XPOST https://api.thebos.co/v1/user-site/photo/13694-IYXTCB | jq '.result.photo' > { "active": 1, "code": "13694-IYXTCB", "date": "December 17, 2022", "time": "3:25am", "defaultFormat": "mp4", "defaultFilename": "events/shelter-pr-holiday-party/13694-IYXTCB_vid.mp4", "bucket": null, "link": "/p/13694-IYXTCB", "hasGif": false, "hasPrint": true, "hasVideo": true, "print": { "id": 6761344, "filename": "events/shelter-pr-holiday-party/13694-IYXTCB.gif", "thumbnail_sm": "https://s3.amazonaws.com/thebosco/events/shelter-pr-holiday-party/13694-IYXTCB_180.gif", "thumbnail_lg": "https://s3.amazonaws.com/thebosco/events/shelter-pr-holiday-party/13694-IYXTCB_400.gif", "url": "https://s3.amazonaws.com/thebosco/events/shelter-pr-holiday-party/13694-IYXTCB.gif" }, "video": { "id": 6761343, "filename": "events/shelter-pr-holiday-party/13694-IYXTCB_vid.mp4", "url": "https://s3.amazonaws.com/thebosco/events/shelter-pr-holiday-party/13694-IYXTCB_vid.mp4" }, "created": "2022-12-17T03:25:35.000Z" } ``` For the Site Redesign, we want to approach this more like a standard carousel. Need a new endpoint that returns _all the assets_ for an event, with the same fields as the singular endpoint above. ``` # Example proposed endpoint $ curl -XPOST https://api.thebos.co/v3/photos?event=foo should return a list of all photos for event foo, e.g.: [ { "active": 1, "code": "13694-IYXTCB", "date": "December 17, 2022", "time": "3:25am", "defaultFormat": "mp4", "defaultFilename": "events/shelter-pr-holiday-party/13694-IYXTCB_vid.mp4", "bucket": null, "link": "/p/13694-IYXTCB", "hasGif": false, "hasPrint": true, "hasVideo": true, ... "video": { "id": 6761343, "filename": "events/shelter-pr-holiday-party/13694-IYXTCB_vid.mp4", "url": "https://s3.amazonaws.com/thebosco/events/shelter-pr-holiday-party/13694-IYXTCB_vid.mp4" }, "created": "2022-12-17T03:25:35.000Z" }, ... ]