API PROCESSMAKER version 4.1.0 AND 4.1.18
I have a problem with the APIs, either doing the try out from swagger or consuming the API from other code, the error that comes out is unauthenticated, I already tried passing the token of the admin user in the field of pm_api_bearer and also automatically from swagger that is redirected to processmaker for login approval.
To connect or test the api I use the processmaker documentation, which uses https://staging-pm4.processmaker.net/api/documentation. obviously applied to my server https: {server ip of my processmaker} / api / documentation. In the swagger I can log in perfectly using the authorize button, but when I want to try an api in the same place, the result I have is the following:
Error: Unauthorized
I have also tried the api through the console, with curl, passing it the user token created in the processmaker, as the processmaker wiki says on github (https://github.com/ProcessMaker/processmaker/wiki/API-Authentication) but I get the same result.
Curl example:
$ export TOKEN = “your generated token” $ curl -H ‘Accept: application / json’ -H “Authorization: Bearer $ {TOKEN}” {server ip of my processmaker}
in the token in the curl or in the pm_api_bearer (http, Bearer) (PREVIOUS SCREENSHOTS). I introduce the token generated by processmaker in the path admin -> user -> API TOKEN.