‎16-03-2023 10:39 AM - edited ‎16-03-2023 11:28 AM
Starting from HOPEX V5 the method for authentication for API has evolved.
Former Bearer Token is not available in V5. Oauth2 Authentication is not supported for the moment for API calls.
Depending on the use case you want to use the API you may use one or the other authentication method. Regardless of the chosen authentication methods the others headers and body information will remain the same.
The basis Auth allow you to access the API directly with credentials : loing/password.
curl --location --request POST 'httpx://www.myserver.com/HOPEXGraphQL/api/ITPM' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic V2Vic2VydmljZTpIb3BleA==' \
--data-raw '{"query":"query {\n application {\n id\n name\n cloudComputing\n }\n}","variables":{}}'
This authentication method is useful when you need to check identity and get the data with a login/password logic. It is nonetheless less secure than an API Key.
You need to create a dedicated User/Password within the HAS console to be able to use it in API Call. This user can be :
Process step :
You can now use this login/password for API call.
To access the API with an API Key you need to create it and defined all the technical information.
Once you will have defined this information the system will give you the API key. this API Key can be valid for all time or have a validity period.
The API Key generate does not contains any information that can be decrypted or decoded.
It is recommended Authentication methods whenever possible. It is ideal when scripting, when developing external app or when doing integration with external tools.
Now you can make call to any endpoint.
curl --location 'https://w-ogd/HOPEXGraphQL/api/ITPM' \
--header 'x-api-key: 5snybEHxGR8uTRAks2ySEgYs8t82rQ6KqkrcEsp9srw737WmPZcJvpk1gNctBCjVQZvBwrryaFzJkHk61Q1eFJex' \
--header 'Content-Type: application/json' \
--data '{"query":"query\n{\n application\n {\n id\n name\n }\n}","variables":{}}'
You need to create a dedicated API Key within the HAS console to be able to use it in API Call. This API Key can be :
Process step :
You can now use this login/password for API call.
Caution :
This mode will change the behaviour in the back-end to process the request. When to choose which one :
Multi : for all purposes where you need responsiveness in the API calls.
Single : for heavy computing treatment. Ideal for heavy batch or static website generation
Solved! Go to Solution.
‎31-05-2023 04:18 PM
We are migrating from Hopex v4 cp7 to V5, we are using Graph QL API in v4. After V5 upgrade, we are able to login to web client but Graph QL API is not working. Create user and password per the documentation in admin console, copied the custom json. Basic Auth and API keys are both failing..
‎31-05-2023 09:30 AM
@pgunna Can you please explain more you problem ?
‎30-05-2023 11:08 PM
I have the same issue, how did you resolve the graphql URL issue
‎22-03-2023 12:05 PM
I have added the sample as before
‎22-03-2023 11:27 AM - edited ‎22-03-2023 12:08 PM
Hi Olivier,
When we wrote https://xxx/hopexgraphql in Hopex V4, the graphql page was opening. I'm trying to understand what's the difference in v5
Kind Regards
‎20-03-2023 01:56 PM
Hi Olivier,
Thank you for the information.
I see environment as empty.
(For V4 you previously had an environment named "Sample.postman_environment")
Kind Regards
‎20-03-2023 11:57 AM
‎20-03-2023 11:54 AM
Hi Olivier,
Is there an environment and collection according to v5 to use in postman?
Tnx
Tnx