We'll describe the approach based on an example.
The task (problem/issue/you name it)
How can I use the API to add an installed integration to a project and also add a given token.
The approach
The Allure Testops API makes requests from the frontend of the application to the backend, meaning all you will be doing is pretending to be the frontend.
This is done as follows
Let's reword the task: you need to add globally configured integration with existing user credentials to an arbitrary project.
How to perform such a task.
- open developer tools in your browser
- open the project integration page
- click Add integration
- enter credentials for integration
- check that they are accepted by the remote system (test connection)
- Click Add integration
- In Devtools, find the API request that was sent when you clicked Add integration
- You will need data from Headers and Payloads
- The headers show you exactly which API method and its type was used (GET, POST, etc.)
- Payload will give you all the data you need to use
- Descriptions of all API calls are available at {URL}/swagger-ui.html, you can find the one you need by simply searching the page
- The description of authentication for executing API requests is described in the documentation: https://docs.qameta.io/allure-testops/advanced/api/#authentication
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article