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

POST to send API returns 405 #2722

Closed
namiwang opened this issue May 4, 2024 · 3 comments
Closed

POST to send API returns 405 #2722

namiwang opened this issue May 4, 2024 · 3 comments

Comments

@namiwang
Copy link

namiwang commented May 4, 2024

Describe the Bug

With Umami Cloud and my API key I can make a request to /v1/websites endpoint:

GET /v1/websites HTTP/1.1
x-umami-api-key: [key]
Accept: application/json
Host: api.umami.is
Connection: close
User-Agent: RapidAPI/4.2.0 (Macintosh; OS X/14.4.1) GCDHTTPRequest

However, with the same key and POSTing to /v1/send I'm getting a 405 error

POST /v1/send HTTP/1.1
x-umami-api-key: [key]
Accept: application/json
Content-Type: application/json
Host: api.umami.is
Connection: close
User-Agent: RapidAPI/4.2.0 (Macintosh; OS X/14.4.1) GCDHTTPRequest
Content-Length: 249

{"payload":{"hostname":"[redacted]","language":"en-US","referrer":"[redacted]","screen":"2560x1440","title":"","url":"[redacted]","website":"[redacted]","name":"[redacted]"},"type":"event"}
HTTP/1.1 405 Method Not Allowed
Cache-Control: public, max-age=0, must-revalidate
Content-Disposition: inline; filename="404"
Content-Type: text/html; charset=utf-8
Date: Sat, 04 May 2024 04:01:23 GMT
Server: Vercel
Strict-Transport-Security: max-age=63072000
X-Matched-Path: /404
X-Vercel-Cache: BYPASS
X-Vercel-Id: hnd1::6n2s2-1714795283496-273d303c2f16
Connection: close
Transfer-Encoding: chunked

The docs are not consistent about the API host so I've also tried /v1/send, /api/v1/send but all response with 405.

Database

PostgreSQL

Relevant log output

No response

Which Umami version are you using? (if relevant)

No response

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@mikecao
Copy link
Collaborator

mikecao commented May 4, 2024

The API currently does not support sending data to it. You will need to send to whatever region your website is location. Either analytics.us.umami.is or analytics.eu.umami.is.

@namiwang
Copy link
Author

namiwang commented May 4, 2024

The API currently does not support sending data to it. You will need to send to whatever region your website is location. Either analytics.us.umami.is or analytics.eu.umami.is.

Thanks @mikecao , I changed the host to analytics.us.umami.is but I'm still getting a 405 error. What path/data should I post to the endpoint? I'm referring the docs here

@franciscao633
Copy link
Collaborator

Are you still having issues? Here's an example of the endpoint and test data with a 200 response.

image

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