Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #3611

Closed
Open
Created Apr 16, 2013 by Administrator@rootOwner

Api: How to use it with curl?

Created by: Athius

Hello everybody,

I am a new user of those kind of api so I think it's a dumb question...:

How to use the Gitlab API with curl command?

I try this:

curl -i -H "Accept: application/json" -H "Content-type: application/json" -X GET --header "PRIVATE-TOKEN: MYTOKEN" "http://MYSERVER/api/v3/projects"

And I obtain the list of all the projects (that's ok).

But when I try to get just one project with the id I always have a 404 message. Here my command:

curl -i -H "Accept: application/json" -H "Content-type: application/json" -X GET --header "PRIVATE-TOKEN: MYTOKEN" --data '{id:1}' "http://MYSERVER/api/v3/projects/:id"

Did I do some mistake in my command?

Thanks,

Romain

Assignee
Assign to
Time tracking