0

I'am currently trying to get the status of a GitLab job with Javascript on GitLab Pages.

I have tried the following but I always receive an error 404 not found.

fetch('https://gitlab.devops.telekom.de/api/v4/projects/165107/jobs', {
    method: 'POST',
    headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json',
        'PRIVATE-TOKEN': 'TOKEN'
    },
    body: JSON.stringify({ "id": 78912 })
  }).then(response => response.json()).then(response => console.log(JSON.stringify(response)));
3
  • stackoverflow.com/questions/15341918/… Commented Jan 20, 2023 at 14:08
  • If that's a real private token, you may want to consider rotating it ASAP. Commented Jan 20, 2023 at 14:12
  • The token was revoked before posting this question, but I should have replaced it nonetheless, thanks. Commented Jan 21, 2023 at 16:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.