Hello! I’m new in Mautic and I’m having some trouble trying to understand how to do the requests on the API.
When the user enter in my page, the authentication begins and I receive the access_token normally.
Later, I created another file( invitation.php) which is responsible for create a new contact inside Mautic.
Hi @italoborges you need to save the tokens each time because if you are using OAuth2 it will change at some point!. See the main API page https://github.com/mautic/api-library it shows you code that you need to use to check if the tokens have changed. If they have ,you need to save it for next time. The API does not provide any storage for the tokens so you need to look after them.
As an alternative, you could consider using BasicAuth. This should be available in the next API release.