Raw data JSON API
Hello @mikecao, first of all, thanks for this awesome contribution !
I just wanted to ask you if there has been plans to have an API for the raw data as JSON
Regards
The app itself uses API calls to get data. It's not documented but you can watch your network requests to make the same calls or look through the source code.
Thank you !
But how to handle auth in that case ?
What I did was to make a HTTP request to the auth endpoint:
POST [localhost:3000]/api/auth/login
data: { username: 'admin', password: ***** (your pass)}
this will return a token, this token then you pass on every other Request as a cookie with the key "umami.auth". For example to create a new website:
POST [localhost:3000]/api/website
headers: { 'cookie': "umami.auth=[THE_TOKEN]"}
data: { name: [MY_WEB], domain, etc....}
@juanitoddd thank you i'll try
Just in case someone else is running into this, I wrote myself a small API wrapper in JS to access the umami data. Might be useful to someone else: https://gist.github.com/joshinat0r/8f3428ab0a1de834d07efd29703c2c3f