Register webhook with literal true/false/null and a backtick
Try it
POST
/webhooksThe example payload below contains the strings true, false, null,
and a literal backtick. Switch language tabs in the code-sample switcher
and verify Python emits "true" not True, Go emits an interpreted
string (with ``` escaped) not a backtick-delimited raw string.
Authentication
No authentication required.
Request body
Content type: application/json
- object
eventsstring[]notestringenabledboolean
Response
201Created
curl -X POST 'https://api.example.com/v1/webhooks' \
-H 'Content-Type: application/json' \
-d '{
"events": [
"true",
"false",
"null"
],
"note": "this contains a `backtick` value",
"enabled": true
}'const response = await fetch('https://api.example.com/v1/webhooks', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"events": [
"true",
"false",
"null"
],
"note": "this contains a `backtick` value",
"enabled": true
})
});
const data = await response.json();
console.log(data);interface ApiResponse {
// shape your response here
}
const response: Response = await fetch('https://api.example.com/v1/webhooks', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"events": [
"true",
"false",
"null"
],
"note": "this contains a `backtick` value",
"enabled": true
})
});
const data = (await response.json()) as ApiResponse;
console.log(data);import requests
url = "https://api.example.com/v1/webhooks"
headers = {
"Content-Type": "application/json"
}
payload = {
"events": [
"true",
"false",
"null"
],
"note": "this contains a `backtick` value",
"enabled": True
}
response = requests.request("post", url, headers=headers, json=payload)
print(response.json())package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader("{\n \"events\": [\n \"true\",\n \"false\",\n \"null\"\n ],\n \"note\": \"this contains a `backtick` value\",\n \"enabled\": true\n}")
req, err := http.NewRequest("POST", "https://api.example.com/v1/webhooks", body)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
}