Create a GitLab webhook for this organization
curl --request POST \
--url https://app.trustivan.com/api/v1/code-integrations/gitlab \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"host": "gitlab.com"
}
'import requests
url = "https://app.trustivan.com/api/v1/code-integrations/gitlab"
payload = { "host": "gitlab.com" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({host: 'gitlab.com'})
};
fetch('https://app.trustivan.com/api/v1/code-integrations/gitlab', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/code-integrations/gitlab"
payload := strings.NewReader("{\n \"host\": \"gitlab.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Create a GitLab webhook for this organization
Requires credentials:manage. Returns webhook_url and
secret_token once; paste both into the GitLab project’s webhook
settings (Merge request events). Results are posted with the
organization’s stored git credential for the host, which needs the
api scope.
POST
/
code-integrations
/
gitlab
Create a GitLab webhook for this organization
curl --request POST \
--url https://app.trustivan.com/api/v1/code-integrations/gitlab \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"host": "gitlab.com"
}
'import requests
url = "https://app.trustivan.com/api/v1/code-integrations/gitlab"
payload = { "host": "gitlab.com" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({host: 'gitlab.com'})
};
fetch('https://app.trustivan.com/api/v1/code-integrations/gitlab', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/code-integrations/gitlab"
payload := strings.NewReader("{\n \"host\": \"gitlab.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Response
{installation, webhook_url, secret_token}.