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

Question about API formatting #1047

Open
rdegges opened this issue Jun 12, 2024 · 3 comments
Open

Question about API formatting #1047

rdegges opened this issue Jun 12, 2024 · 3 comments

Comments

@rdegges
Copy link
Contributor

rdegges commented Jun 12, 2024

Hi there! Really love this project =D

I work at Snyk and am currently building an integration with your API to help us find events we might want to speak at/sponsor/etc. This is really nifty!

As I've been diving into this a bit more, I have a generic question (sorry if this isn't the best place for it).

I'm primarily using the all-events JSON endpoint: https://developers.events/all-events.json

The format of event entries returned by the API looks like this today:

{
  "name": "KubeCon + CloudNativeCon NA 2023",
  "date": [
    1699228800000,
    1699574400000
  ],
  "hyperlink": "https://events.linuxfoundation.org/kubecon-cloudnativecon-north-america/",
  "location": "Chicago (USA)",
  "city": "Chicago",
  "country": "USA",
  "misc": "<a href="[https: //sessionize.com/kubecon-cloudnativecon-north-america-2023/"><img](https://sessionize.com/kubecon-cloudnativecon-north-america-2023/) alt="CFP KubeCon NA 2023" src="[https: //img.shields.io/static/v1?label=CFP&message=until%2018-June-2023&color=red"></a>](https://img.shields.io/static/v1?label=CFP&message=until%2018-June-2023&color=red)",
  "cfp": {
    "link": "https://sessionize.com/kubecon-cloudnativecon-north-america-2023/",
    "until": "18-June-2023",
    "untilDate": 1687046400000
  },
  "closedCaptions": false,
  "scholarship": false,
  "status": "open"
}

Here's my question: would you be open to potentially changing this format in the future or potentially adding a v2 all-events.json endpoint that allows for some additional formatting? For example, it would be really neat if we could get events back in a format like the following:

{
  "name": "KubeCon + CloudNativeCon NA 2023",
  "date": {
    "start": "2024-03-02",
    "end": "2024-03-02"
  },
  "url": "https://events.linuxfoundation.org/kubecon-cloudnativecon-north-america/",
  "location": "Chicago (US)",
  "city": "Chicago",
  "country": "US",
  "misc": "<a href="[https: //sessionize.com/kubecon-cloudnativecon-north-america-2023/"><img](https://sessionize.com/kubecon-cloudnativecon-north-america-2023/) alt="CFP KubeCon NA 2023" src="[https: //img.shields.io/static/v1?label=CFP&message=until%2018-June-2023&color=red"></a>](https://img.shields.io/static/v1?label=CFP&message=until%2018-June-2023&color=red)",
  "cfp": {
    "url": "https://sessionize.com/kubecon-cloudnativecon-north-america-2023/",
    "end": "2024-12-12"
  },
  "closedCaptions": false,
  "scholarship": false,
  "status": "open"
}

There are a few key changes here:

  • The date array field with UTC timestamps has been changed to an object with "start" and "end" attributes that are strings with YYYY-MM-DD formatting. This is handy since, from what I can tell, no events include specific hour/minute/second/ms info so it's easier to parse/work with.
  • The hyperlink field has been renamed url for consistency (more info below)
  • The country field now uses standard country codes (two letters) for more easy parsability. This way it uses the ISO country codes.
  • The cfp.link field has been renamed cfp.url for consistency (this way, all URLs are referred to with the same field name)
  • The cfp.until field has been renamed cfp.end for consistency with dates above
  • The cfp.end field uses the same date formatting as above: YYYY-MM-DD
  • The status field includes the status in ALL_CAPS and only allows for an enum of options. For example, this might include statuses like: "OPEN", "DONE", "DELAYED", "CANCELED", ... But having these standardized would make it easier to parse/work with, since right now statuses look a tiny bit inconsistent, e.g., "open", "Virtualized", "Canceled", etc.

I'd be happy to contribute, but am curious what your thoughts are on the approach above, if it even makes sense, etc. Thanks for your time! <3

@HanzCEO
Copy link
Contributor

HanzCEO commented Jun 23, 2024

Hi @rdegges,
The endpoint is managed entirely by the community. Thus, I would suggest that in the meantime you create a script to reformat the v1 structure to your liking.

@rdegges
Copy link
Contributor Author

rdegges commented Jun 23, 2024

No problemo! I'm currently doing that, was just curious if you were all interested in potentially accepting some changes to tweak the formatting a bit, but no worries at all.

Thanks for the great project! =D

@scraly
Copy link
Owner

scraly commented Aug 22, 2024

Hi,
I'm curious about what u said:
"I work at Snyk and am currently building an integration with your API to help us find events we might want to speak at/sponsor/etc. This is really nifty!"

Do u think you can open source in this repository your integration? (maybe it can help people)

Moreover, if Snyk use it, I think it could be a good idea to sponsor this repository in order to support this project :).

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

3 participants