logo

Ejemplos

Last update: 2 hours ago by Emmanuel Gutierrez Solano

Petición HTTP con header texto

curl -X POST 'http://{{url}}/api-template' \
-H 'Authorization: Bearer {{api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"from": "5215500000001",
"to": "5215500000002",
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"workgroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"campaignId": "campaign001",
"type": "template",
"message": {
"templateId": 9007199254740991,
"template": {
"components": [
{
"type": "header",
"parameters": [
{
"type":"text",
"text":"123456"
}
]
}
]
}
}
}'

Petición HTTP con body texto

curl -X POST 'http://{{url}}/api-template' \
-H 'Authorization: Bearer {{api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"contactName": "Juan",
"from": "5215500000001",
"to": "5215500000002",
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"workgroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"campaignId": "campaign001",
"type": "template",
"message": {
"templateId": 9007199254740991,
"template": {
"components": [{
"type": "body",
"parameters": [{
"type":"text",
"text":"123456"
}]
}]
}
}
}'

Petición HTTP con header currency

curl -X POST 'http://{{url}}/api-template' \
-H 'Authorization: Bearer {{api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"contactName": "Juan",
"from": "5215500000001",
"to": "5215500000002",
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"workgroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"campaignId": "campaign001",
"type": "template",
"message": {
"templateId": 9007199254740991,
"template": {
"components": [{
"type": "header",
"parameters": [{
"type":"currency",
"currency": {
"fallbackValue": "$100.99",
"code": "MXN",
"amount": 222990
}
}]
}]
}
}
}'

Petición HTTP con body currency

curl -X POST 'http://{{url}}/api-template' \
-H 'Authorization: Bearer {{api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"contactName": "Juan",
"from": "5215500000001",
"to": "5215500000002",
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"workgroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"campaignId": "campaign001",
"type": "template",
"message": {
"templateId": 9007199254740991,
"template": {
"components": [{
"type": "body",
"parameters": [{
"type":"currency",
"currency": {
"fallbackValue": "$100.99",
"code": "MXN",
"amount": 222990
}
}]
}]
}
}
}'

Petición HTTP con header date time

curl -X POST 'http://{{url}}/api-template' \
-H 'Authorization: Bearer {{api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"contactName": "Juan",
"from": "5215500000001",
"to": "5215500000002",
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"workgroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"campaignId": "campaign001",
"type": "template",
"message": {
"templateId": 9007199254740991,
"template": {
"components": [{
"type": "header",
"parameters": [{
"type": "date_time",
"date_time": {
"fallbackValue": "Octubre 2, 1990",
"dayOfMonth": 30,
"year": 2021,
"month": 3,
"hour": 13,
"minute": 19
}
}]
}]
}
}
}'

Petición HTTP con body date time

curl -X POST 'http://{{url}}/api-template' \
-H 'Authorization: Bearer {{api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"contactName": "Juan",
"from": "5215500000001",
"to": "5215500000002",
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"workgroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"campaignId": "campaign001",
"type": "template",
"message": {
"templateId": 9007199254740991,
"template": {
"components": [{
"type": "body",
"parameters": [{
"type": "date_time",
"date_time": {
"fallbackValue": "Octubre 2, 1990",
"dayOfMonth": 30,
"year": 2021,
"month": 3,
"hour": 13,
"minute": 19
}
}]
}]
}
}
}'

Petición HTTP imagen

curl -X POST 'http://{{url}}/api-template' \
-H 'Authorization: Bearer {{api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"contactName": "Juan",
"from": "5215500000001",
"to": "5215500000002",
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"workgroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"campaignId": "campaign001",
"type": "template",
"message": {
"templateId": 9007199254740991,
"template": {
"components": [{
"type": "header",
"parameters": [{
"link": "http://victormoran.me/leo/Broadcaster-RCS_API_v1.0.jpg",
"type": "image"
}]
},
{
"type": "body",
"parameters": [{
"text": "ejemplo de texto",
"type": "text"
}]
}]
}
}
}'

Petición HTTP documento

curl -X POST 'http://{{url}}/api-template' \
-H 'Authorization: Bearer {{api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"contactName": "Juan",
"from": "5215500000001",
"to": "5215500000002",
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"workgroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"campaignId": "campaign001",
"type": "template",
"message": {
"templateId": 9007199254740991,
"template": {
"components": [{
"type": "header",
"parameters": [{
"link": "http://victormoran.me/leo/Broadcaster-RCS_API_v1.0.pdf",
"type": "document",
"filename": "RCS Documentation"
}]
},
{
"type": "body",
"parameters": [{
"text": "ejemplo de texto",
"type": "text"
}]
}]
}
}
}'

Petición HTTP video

curl -X POST 'http://{{url}}/api-template' \
-H 'Authorization: Bearer {{api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"contactName": "Juan",
"from": "5215500000001",
"to": "5215500000002",
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"workgroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"campaignId": "campaign001",
"type": "template",
"message": {
"templateId": 9007199254740991,
"template": {
"components": [{
"type": "header",
"parameters": [{
"link": "http://victormoran.me/leo/Broadcaster-RCS_API_v1.0.mp4",
"type": "video"
}]
},
{
"type": "body",
"parameters": [{
"text": "ejemplo de texto",
"type": "text"
}]
}]
}
}
}'

Petición HTTP botones

curl -X POST 'http://{{url}}/api-template' \
-H 'Authorization: Bearer {{api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"contactName": "Juan",
"from": "5215500000001",
"to": "5215500000002",
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"workgroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"campaignId": "campaign001",
"type": "template",
"message": {
"templateId": 9007199254740991,
"template": {
"components": [{
"type": "body",
"parameters": [{
"text": "Juan",
"type": "text"
}]
},
{
"type": "button",
"subtype": "quick_reply",
"index": "0",
"parameters": [{
"type": "payload",
"payload": "12345765"
}]
},
{
"type": "button",
"subtype": "quick_reply",
"index": "1",
"parameters": [{
"type": "payload",
"payload": "12345765"
}]
},
{
"type": "button",
"subtype": "quick_reply",
"index": "2",
"parameters": [{
"type": "payload",
"payload": "12345765"
}]
}]
}
}
}'
VentaChat — Anterior
Conexión HTTP
Siguiente
Respuesta