How to get Job details with the CircleCI API V2

You can use the CircleCI V2 API to get job details.

Instructions

Using a curl GET request as shown below you will need to replace the project-slug which is your VCS information in the example below this is CircleCI-Public/api-preview-docs and the job number. You will also need to include a form of authorization which can be an api_key_header basic_auth or an api_key_query. A guide can be found under additional resources for utilizing basic authorization.

curl --request GET \
  --url https://circleci.com/api/v2/project/gh/CircleCI-Public/api-preview-docs/job/123 \
  --header 'authorization: Basic REPLACE_BASIC_AUTH'

Outcome

You will retrieve the data for the job.

Additional Resources

A link to the API can be found here: https://circleci.com/docs/api/v2/index.html#tag/Job

A link to utilizing authorization can be found here: https://support.circleci.com/hc/en-us/articles/360052405651-Utilizing-Basic-Authorization-in-CircleCI-API-Calls

Was this article helpful?
0 out of 8 found this helpful

Comments

0 comments

Article is closed for comments.