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

How to get token_auth programmatically, e.g. using OAuth 2.0 ? #14163

Closed
saadsarfrazz opened this issue Mar 4, 2019 · 2 comments
Closed

How to get token_auth programmatically, e.g. using OAuth 2.0 ? #14163

saadsarfrazz opened this issue Mar 4, 2019 · 2 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@saadsarfrazz
Copy link

Hi,

I am working on "Reporting HTTP API" to export data from matomo.
It is mentioned here
https://developer.matomo.org/api-reference/reporting-api#authenticate-to-the-api-via-token_auth-parameter
that token_auth can be generated manually (in user settings) to be used in API reporting.
I wanted to ask if there as any programmatic way to retrieve this token e.g. using OAuth 2.0 may be?
Also what is that age of token_auth.Does it not expire unless user regenerates it?

Regards,

Saad.

@tsteur
Copy link
Member

tsteur commented Mar 4, 2019

You can find more info about APIs here: https://developer.matomo.org/api-reference/reporting-api

Checkout UsersManager.getTokenAuth method to get token. There is no oauth and token doesn't expire unless you regenerate.

For further questions please ask in the forums: https://forum.matomo.org

@tsteur tsteur closed this as completed Mar 4, 2019
@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label Mar 4, 2019
@Findus23
Copy link
Member

Just for future reference: Matomo 4 allows creating multiple API token per user and you can use UsersManager.createAppSpecificTokenAuth to create a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

3 participants