How do you save the response object into a variable?

From this documentation : Projects API | GitLab
I want to save this response into a variable :

  "alt": "dk",
  "url": "/uploads/66dbcd21ec5d24ed6ea225176098d52b/dk.png",
  "full_path": "/namespace1/project1/uploads/66dbcd21ec5d24ed6ea225176098d52b/dk.png",
  "markdown": "![dk](/uploads/66dbcd21ec5d24ed6ea225176098d52b/dk.png)"

I tried 2 things but didn’t work for me :

json=$(curl --request POST --header “PRIVATE-TOKEN:” --header “Content-Type:multipart/form-data” --form “file=@./ticket.json” “”)

json=`curl --request POST --header “PRIVATE-TOKEN:” --header “Content-Type:multipart/form-data” --form “file=@./ticket.json” “” ``

both these methods doesn’t work for me .

Where is your project id in the URL? The API endpoint is

Sorry to post incomplete url , But in the script project Id was there , I manage to make it work by Saving the output in to a file

  • curl --request POST --header “PRIVATE-TOKEN:${VERSION_UPDATE_TOKEN}” --header “Content-Type:multipart/form-data” --form “file=@./ticket.json” “${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/uploads” >> path.json