Skip to content

Cannot create Webhook #62

@costibleotu

Description

@costibleotu

Hi,

I'm using Gogs Version: 0.10.34.0330 / 0.11 RC.

I'm trying to create a hook through the api, and I get this response:
[{"fieldNames":["Config"],"classification":"RequiredError","message":"Required"}]

My code is:

import requests

organization = 'test'
repo_name = 'test'
token = 'ac16d61127466efc3d316db76e68b7358c8075b4'

data = {
    "type": "gogs",
    "config": {
        "url": "http://192.168.201.1:8080/hook",
        "content_type": "json"
    },
    "events": [
        "create",
        "delete",
        "fork",
        "push",
        "issues",
        "issue_comment",
        "pull_request",
        "release",
    ],
    "active": True
}

url = "http://192.168.201.100:3000/api/v1/repos/{o}/{r}/hooks?token={t}".format(o=organization, r=repo_name, t=token)

session = requests.Session()
response = session.post(url, data=data)
print response.text

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions