From 59b0e2f45db47110d63bfb0707a435b7186c6aeb Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 19 Oct 2021 15:12:08 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- doc/api/jobs.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'doc/api/jobs.md') diff --git a/doc/api/jobs.md b/doc/api/jobs.md index ac8b756beac..51a0875cd99 100644 --- a/doc/api/jobs.md +++ b/doc/api/jobs.md @@ -400,11 +400,12 @@ Retrieve the job that generated a job token. GET /job ``` -Examples +Examples (must run as part of the [`script`](../ci/yaml/index.md#script) section of a [CI/CD job](../ci/jobs/index.md)): ```shell -curl --header "JOB-TOKEN: " "https://gitlab.example.com/api/v4/job" -curl "https://gitlab.example.com/api/v4/job?job_token=" +curl --header "Authorization: Bearer $CI_JOB_TOKEN" "${CI_API_V4_URL}/job" +curl --header "JOB-TOKEN: $CI_JOB_TOKEN" "${CI_API_V4_URL}/job" +curl "${CI_API_V4_URL}/job?job_token=$CI_JOB_TOKEN" ``` Example of response -- cgit v1.2.1