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
  • #6202

Closed
Open
Created Jan 30, 2014 by Administrator@rootOwner

Can't add project hook via API

Created by: jproffitt

I can't seem to add or update project web hooks through the API.

This is the request:

POST { url }/api/v3/projects/146/hooks HTTP/1.1
PRIVATE-TOKEN: { token }

url=http%3A%2F%2Fwww.google.com&

And the response:

304 Not Modified
Content-Type: application/json 
Content-Length: 205 

[
    {
        "id":57,"url":"{ original url - not google.com }",
        "created_at":"2013-12-12T18:10:36.387Z",
        "project_id":146,
        "push_events":true,
        "issues_events":false,
        "merge_requests_events":false
    }
]

If I look in the gitlab interface, there is no google.com hook.

If I were to do a PUT request to update that existing web hook, I get a 400 bad request response.

Its almost like its doing the same behavior of a GET request rather than a POST. It just returns a list of web hooks, rather than creating a new one.

Am I doing something wrong, or is this a bug? I am using pyapi-gitlab (https://github.com/Itxaka/pyapi-gitlab). Also tried manually with the chrome extension: "Advanced Rest Client".

Assignee
Assign to
Time tracking