REST API para M&S CRM
API REST sobre HTTPS con JSON. Métodos HTTP y códigos de estado estándar. Token por instalación.
Introducción
La API de M&S opera sobre HTTPS y utiliza JSON como formato de datos. Es una API RESTful y emplea métodos y códigos de estado HTTP para expresar solicitudes y respuestas. Un token se vincula a una instalación completa de M&S. Para interactuar con otra instalación diferente, debes crear un token en esa instalación.
Autenticación
Usa el authtoken en el encabezado de cada solicitud.
Para operaciones POST/PUT se utiliza multipart/form-data.
Rutas con index.php/: si tu instalación usa URLs enrutadas con index.php/, inclúyelo en la ruta de tus solicitudes. Algunos servidores ignoran la barra final; si recibes Route not found, prueba añadir o quitar index.php/ o la barra de cierre.
Ejemplo de uso
Escenario: Con token jEheVytlAoFl7F8MqUQ7jAo2hOXAS, listar tickets:
curl -H "authtoken: jEheVytlAoFl7F8MqUQ7jAo2hOXAS" \
"https://crm.myscreators.com/index.php/api/tickets"Crea un cliente nuevo. (En tu doc se muestra respuesta “Client add successful.”)
Client add successful
POST /index.php/api/clients HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 72
{
"company_name": "text",
"address": "text",
"phone": "text",
"website": "text"
}Client add successful
{
"status": true,
"message": "Operation successful."
}Cliente
GET /index.php/api/clients/{id} HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Cliente
{
"id": 2,
"company_name": "jdoe",
"address": "Rajkot",
"created_date": "2025-12-06",
"is_lead": "0",
"lead_status_id": "1",
"owner_id": "1",
"primary_contact": "john doe",
"total_projects": "7"
}Eliminado
DELETE /index.php/api/clients/{id} HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Eliminado
{
"status": true,
"message": "Operation successful."
}Coincidencias de clientes
GET /index.php/api/getClientsSearch/search/{keysearch} HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Coincidencias de clientes
[
{
"id": 1,
"company_name": "text",
"invoice_value": "text",
"client_groups": "text"
}
]Creado
POST /index.php/api/leads HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 217
{
"company_name": "text",
"owner_id": "text",
"lead_status_id": "text",
"lead_source_id": "text",
"address": "text",
"city": "text",
"state": "text",
"zip": "text",
"country": "text",
"phone": "text",
"website": "text",
"vat_number": "text"
}Creado
{
"status": true,
"message": "Operation successful."
}Lead
GET /index.php/api/leads/{id} HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Lead
{
"id": 2,
"company_name": "Test",
"address": "text",
"city": "text",
"state": "text",
"zip": "text",
"country": "text",
"created_date": "2025-12-06",
"website": "text",
"phone": "text",
"lead_status_title": "New",
"owner_name": "john doe"
}Actualizado
PUT /index.php/api/leads/{id} HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 217
{
"company_name": "text",
"owner_id": "text",
"lead_status_id": "text",
"lead_source_id": "text",
"address": "text",
"city": "text",
"state": "text",
"zip": "text",
"country": "text",
"phone": "text",
"website": "text",
"vat_number": "text"
}Actualizado
{
"status": true,
"message": "Operation successful."
}Si tu instalación no ofrece esta ruta, usa /projects/search/{keysearch} según la nota del doc.
Coincidencias de leads
GET /index.php/api/leads/search/{keysearch} HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Coincidencias de leads
[
{
"id": 1,
"company_name": "text",
"lead_status_title": "text"
}
]Proyectos
GET /index.php/api/projects/ HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Proyectos
[
{
"id": 2,
"title": "project 1",
"description": "text",
"start_date": "text",
"deadline": "text",
"client_id": "2",
"status": "open",
"company_name": "jdoe",
"currency_symbol": "INR"
}
]Creado
POST /index.php/api/projects HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 76
{
"title": "text",
"client_id": "text",
"start_date": "text",
"description": "text"
}Creado
{
"status": true,
"message": "Operation successful."
}Actualizado
PUT /index.php/api/projects/{id} HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 76
{
"title": "text",
"client_id": "text",
"start_date": "text",
"description": "text"
}Actualizado
{
"status": true,
"message": "Operation successful."
}Eliminado
DELETE /index.php/api/projects/{id} HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Eliminado
{
"status": true,
"message": "Operation successful."
}Coincidencias de proyectos
GET /index.php/api/projects/search/{keysearch} HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Coincidencias de proyectos
[
{
"id": 1,
"title": "text",
"status": "text"
}
]Tickets
GET /index.php/api/tickets HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Tickets
[
{
"id": 1,
"client_id": "2",
"project_id": "0",
"ticket_type_id": "1",
"title": "Title",
"created_by": "1",
"requested_by": "4",
"created_at": "2021-09-12 06:47:36",
"status": "new",
"last_activity_at": "2021-09-12 06:47:36",
"assigned_to": "3",
"labels": "9,10",
"ticket_type": "General Support",
"company_name": "Company",
"assigned_to_user": "john doe"
}
]Opcional (IDs separados por coma)
Creado
POST /index.php/api/tickets HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 149
{
"title": "text",
"client_id": "text",
"requested_by_id": "text",
"ticket_type_id": "text",
"description": "text",
"assigned_to": "text",
"ticket_labels": "text"
}Creado
{
"status": true,
"message": "Operation successful."
}Ticket
GET /index.php/api/tickets/{id} HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Ticket
{
"id": 1,
"client_id": "2",
"project_id": "0",
"ticket_type_id": "1",
"title": "Title",
"created_by": "1",
"requested_by": "4",
"created_at": "2021-09-12 06:47:36",
"status": "new",
"last_activity_at": "2021-09-12 06:47:36",
"assigned_to": "3",
"labels": "9,10",
"ticket_type": "General Support",
"company_name": "Company",
"assigned_to_user": "john doe"
}Actualizado
PUT /index.php/api/tickets/{id} HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 149
{
"title": "text",
"client_id": "text",
"requested_by_id": "text",
"ticket_type_id": "text",
"description": "text",
"assigned_to": "text",
"ticket_labels": "text"
}Actualizado
{
"status": true,
"message": "Operation successful."
}Eliminado
DELETE /index.php/api/tickets/{id} HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Eliminado
{
"status": true,
"message": "Operation successful."
}Coincidencias de tickets
GET /index.php/api/tickets/search/{keysearch} HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Coincidencias de tickets
[
{
"id": 1,
"title": "text",
"status": "text"
}
]Creado
POST /index.php/api/invoices HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 200
{
"invoice_due_date": "text",
"invoice_client_id": "text",
"invoice_bill_date": "text",
"invoice_project_id": "text",
"tax_id": "text",
"tax_id2": "text",
"tax_id3": "text",
"recurring": "text",
"invoice_note": "text"
}Creado
{
"status": true,
"message": "Operation successful."
}Coincidencias de facturas
GET /index.php/api/invoices/search/{keysearch} HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Coincidencias de facturas
[
{
"id": 1,
"client_id": "text",
"status": "text"
}
]Grupos de clientes
GET /index.php/api/client_groups HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Grupos de clientes
[
{
"id": "1",
"title": "Test c group",
"deleted": "0"
}
]Etiquetas de factura
GET /index.php/api/invoice_labels HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Etiquetas de factura
[
{
"id": "text",
"title": "text",
"color": "text",
"context": "text",
"deleted": "text"
}
]Impuestos configurados
GET /index.php/api/invoice_tax HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Impuestos configurados
[
{
"id": "1",
"title": "Tax (10%)",
"percentage": "10",
"deleted": "0"
}
]Etiquetas de proyecto
GET /index.php/api/project_labels HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Etiquetas de proyecto
[
{
"id": "text",
"title": "text",
"color": "text",
"context": "text",
"deleted": "text"
}
]Miembros de proyecto
GET /index.php/api/getProjectMembers HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Miembros de proyecto
[
{
"id": "6",
"user_id": "1",
"project_id": "1",
"is_leader": "1",
"member_name": "Fname Lname",
"user_type": "staff"
}
]Contactos del cliente
GET /index.php/api/contact_by_clientid/{clientid} HTTP/1.1
Host: crm.myscreators.com
authtoken: YOUR_API_KEY
Accept: */*
Contactos del cliente
[
{
"id": "6",
"first_name": "Fname",
"last_name": "Lname",
"user_type": "client",
"status": "active",
"client_id": "3"
}
]Última actualización

