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

Wrong unix epoch in admin api requests #322

Open
m1keru opened this issue Sep 23, 2024 · 1 comment
Open

Wrong unix epoch in admin api requests #322

m1keru opened this issue Sep 23, 2024 · 1 comment

Comments

@m1keru
Copy link

m1keru commented Sep 23, 2024

Hello,
Thank you for your library it's really usefull!
However, I found that Organization API is not working properly.
I noticed during the debug that requests to the API go with Unix timestamp in seconds but Atlassian API wants milliseconds.

Here is the reference to their API:
https://developer.atlassian.com/cloud/admin/organization/rest/api-group-events/#api-v1-orgs-orgid-events-get

from
string

The earliest date and time of the event are represented as a UNIX epoch time in milliseconds.
{"level":"debug","ts":1727100247.123214,"caller":"atlassian_log_exporter/exporter.go:116","msg":"Request HTTP: &{GET https://api.atlassian.com/admin/v1/orgs/xxxxxxxxxx/events?cursor=xxxxxxx%3D&from=1727097755 HTTP/1.1 1 1 map[Accept:[application/json] Authorization:[Bearer xxxxx] User-Agent:[curl/7.54.0]] {} 0x661320 0 [] false api.atlassian.com map[] map[] <nil> map[]   <nil> <nil> <nil> {{}} <nil> [] map[]}"}
{"level":"debug","ts":1727100247.123301,"caller":"atlassian_log_exporter/exporter.go:141","msg":"Response HTTP Code: 200"}

Is it possible to change here Unix() to UnixMilli().

timeAsEpoch := int(options.To.Unix())

timeAsEpoch := int(options.From.Unix())

@m1keru
Copy link
Author

m1keru commented Sep 23, 2024

#323

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

1 participant