Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Netlify Analytics API requests #4

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Netlify Analytics API requests #4

wants to merge 6 commits into from

Conversation

DimitarSD
Copy link

@DimitarSD DimitarSD commented Mar 31, 2021

Fixes #355.

Changes proposed in this PR:

  • Adds Netlify Analytics API requests
  • Updates readme.md
  • Removes index.ts

For details regarding API request parameters and responses check the (un)official Netlify Analytics API docs

All needed environment variables are pulled from Vercel (see endpoint-helper.ts)

Testing

To test the endpoints use the provided link from the vercel bot, select the desired route (ex. /page-views), and create a request while also providing the needed data in the request body.

Example body for /page-views:

{
    "from": 1613340000000,
    "to": 1616018399999,
    "resolution": "day"
}

@vercel
Copy link

vercel bot commented Mar 31, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/oceanprotocol/market-stats/DRSZzEENvQ8QNcAydzUeE8Rh4X6T
✅ Preview: https://market-stats-git-netlify-api-oceanprotocol.vercel.app

@DimitarSD DimitarSD marked this pull request as ready for review April 22, 2021 13:54
@mihaisc
Copy link
Contributor

mihaisc commented Jun 4, 2021

Tried to test it and got an error

image

@mihaisc
Copy link
Contributor

mihaisc commented Jun 4, 2021

Works with query string, not with body
https://market-stats-git-netlify-api-oceanprotocol.vercel.app/page-views?from=1603340000000&to=1646018399999&resolution=day

Please add some correct examples/usage scenarios in the readme as well. The readme should be useful for both people that want to develop and people who want to just use this.

@DimitarSD
Copy link
Author

It seems I forgot to update the description after switching to using query string instead of body. Thanks for pointing this out

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants