Saltar al contenido principal

Contrato histórico: POST create-business-webhook

Contrato histórico de API. Esta página describe un contrato anterior. Los métodos, las rutas y las respuestas pueden diferir de la API vigente.

Significado histórico​

Crear webhook del negocio

Este endpoint de la API se utiliza para añadir un webhook de negocio.

API vigente​

Para desarrollar una integración nueva, consulta la referencia o guía vigente enlazada.

Ver la referencia de la API vigente

Parámetros​

[
{
"name": "language",
"in": "path",
"schema": {
"type": "string",
"default": "en"
},
"required": true
},
{
"name": "project",
"in": "path",
"schema": {
"type": "string",
"default": "<redacted-personal>"
},
"required": true
},
{
"name": "business_id",
"in": "path",
"schema": {
"type": "integer",
"format": "int32"
},
"required": true
},
{
"name": "api_version",
"in": "path",
"schema": {
"type": "string",
"default": "v400"
},
"required": true
}
]

Cuerpo de solicitud​

{
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"hook",
"url"
],
"properties": {
"hook": {
"type": "string"
},
"url": {
"type": "string"
}
}
}
}
}
}

Respuestas​

{
"200": {
"description": "200",
"content": {
"application/json": {
"examples": {
"Result": {
"value": "{\n \"error\": false,\n \"result\": {\n \"hook\": \"order_create\",\n \"url\": \"https://example.com/radar/9e7eauii4apb/b0fd9012-c32e-4f40-9792-c31f4d7edf6f/history/50656260-af18-4c37-a49b-3f45d77ce0a4\",\n \"business_id\": \"<redacted-id>\",\n \"id\": 1\n }\n}"
}
},
"schema": {
"type": "object",
"properties": {
"error": {
"type": "boolean",
"example": false,
"default": true
},
"result": {
"type": "object",
"properties": {
"hook": {
"type": "string",
"example": "order_create"
},
"url": {
"type": "string",
"example": "https://example.com/radar/9e7eauii4apb/b0fd9012-c32e-4f40-9792-c31f4d7edf6f/history/50656260-af18-4c37-a49b-3f45d77ce0a4"
},
"business_id": {
"type": "string",
"example": "<redacted-id>"
},
"id": {
"type": "integer",
"example": 1,
"default": 0
}
}
}
}
}
}
}
},
"400": {
"description": "400",
"content": {
"application/json": {
"examples": {
"Result": {
"value": "{\n \"error\": true,\n \"result\": [\n \"ERROR_BUSINESS_WEBHOOK_REGISTER\"\n ]\n}"
}
},
"schema": {
"type": "object",
"properties": {
"error": {
"type": "boolean",
"example": true,
"default": true
},
"result": {
"type": "array",
"items": {
"type": "string",
"example": "ERROR_BUSINESS_WEBHOOK_REGISTER"
}
}
}
}
}
}
},
"401": {
"description": "401",
"content": {
"application/json": {
"examples": {
"Result": {
"value": "{\n \"error\": true,\n \"result\": [\n \"You do not have permission.\"\n ]\n}"
}
},
"schema": {
"type": "object",
"properties": {
"error": {
"type": "boolean",
"example": true,
"default": true
},
"result": {
"type": "array",
"items": {
"type": "string",
"example": "You do not have permission."
}
}
}
}
}
}
}
}