{ "swagger": "2.0", "info": { "title": "1CRM API", "description": "1CRM API to list, read and write Data to 1CRM", "version": "1.0.0" }, "host": "demo.1crm.de", "basePath": "/api.php", "schemes": [ "https" ], "security": [ { "basicAuth": [] } ], "securityDefinitions": { "basicAuth": { "type": "basic" } }, "paths": { "/webhooks": { "x-ms-notification-content": { "schema": { "type": "object", "$ref": "#/definitions/Lead" }, "description": "The Lead fields" }, "post": { "responses": {}, "x-ms-trigger": "single", "summary": "When an Lead is created or updated", "description": "This operation triggers when an Lead is created or updated in 1CRM", "operationId": "createUpdateLeadWebhook", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { "type": "object", "properties": { "type": { "type": "string", "description": "Event Type", "title": "Event Type", "enum": [ "create", "update", "create_update" ] }, "url": { "type": "string", "description": "url", "x-ms-notification-url": true, "title": "", "x-ms-visibility": "internal" }, "model": { "type": "string", "description": "1CRM Object Model", "title": "Model", "default": "Lead", "x-ms-visibility": "internal" }, "filters": { "type": "object", "description": "1CRM Webhook Filter Object, see developer documentation", "properties": { "glue": { "type": "string", "example": "or" }, "conditions": { "type": "array", "items": { "type": "object", "properties": { "field": { "type": "string", "example": "first_name" }, "filter": { "type": "string", "example": "eq" }, "value": { "type": "string", "example": "John" }, "when": { "type": "string", "example": "current_value" } } } } }, "default": { "glue": "or", "conditions": [ { "field": "deleted", "filter": "is_false", "value": "0", "when": "current_value" } ] }, "x-ms-visibility": "advanced" } }, "required": [ "url", "model", "type", "filters" ] } } ] } }, "/data/Lead": { "get": { "operationId": "getLeadList", "parameters": [ { "in": "query", "name": "fields", "x-ms-summary": "The fields to fetch", "type": "array", "items": { "type": "string" }, "required": false, "description": "Array of field names to fetch. When omitted, a limited number of fields are returned, depending on model. Record ID is guaranteed to be returned, and for most models, name and/or _display fields." }, { "in": "query", "name": "query_favorite", "type": "boolean", "x-ms-visibility": "advanced", "required": false, "description": "Query favorites. If set, favorite field will be added to each result row, indicating whether the current user added the item to Favorites. Note that item is in favorites if and only if the value of favorite field is zero" }, { "in": "query", "name": "filter_text", "type": "string", "required": false, "description": "Generic search string. Fields involved in search depend on model" }, { "in": "query", "name": "filters", "x-ms-visibility": "advanced", "type": "array", "items": { "type": "string" }, "required": false, "description": "Filters to apply. To get list of available filters for a model, use metadata. Format: filter[name]=SearchName (deepobject in OpenApi3)" }, { "in": "query", "name": "order", "type": "string", "x-ms-visibility": "advanced", "required": false, "description": "Sort Order" }, { "in": "query", "name": "offset", "type": "integer", "x-ms-visibility": "advanced", "required": false, "description": "Offset in the list to start retrieval from" }, { "in": "query", "name": "limit", "type": "integer", "x-ms-visibility": "advanced", "required": false, "description": "Limits number of records returned" } ], "description": "Get Lead List", "produces": [ "application/json" ], "responses": { "200": { "description": "a json Object with Lead Array and information of total count", "schema": { "type": "object", "properties": { "total_count": { "type": "integer" }, "records": { "type": "array", "items": { "$ref": "#/definitions/Lead" } } } } } }, "summary": "get Lead List from 1CRM" }, "post": { "operationId": "createLead", "parameters": [ { "description": "Lead object to be added to 1CRM", "in": "body", "name": "Lead", "required": true, "schema": { "properties": { "data": { "$ref": "#/definitions/Lead" } }, "type": "object" } } ], "description": "Create a Lead", "produces": [ "application/json" ], "responses": { "200": { "description": "a json Object with Lead Array and information of total count", "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "ID of the newly created Lead" } } } } }, "summary": "create new Lead" } }, "/data/Lead/{id}": { "get": { "operationId": "getSingleLead", "parameters": [ { "in": "path", "name": "id", "type": "string", "required": true, "description": "The id of the record to be fetched" }, { "in": "query", "name": "fields", "type": "array", "items": { "type": "string" }, "required": false, "description": "Array of field names to fetch. When omitted, all available fields are returned." } ], "description": "Get single Lead Object", "produces": [ "application/json" ], "responses": { "200": { "description": "a json Object with Lead record", "schema": { "type": "object", "properties": { "record": { "$ref": "#/definitions/Lead" } } } } }, "summary": "get single Lead Object from 1CRM" }, "patch": { "operationId": "updateSingleLead", "parameters": [ { "in": "path", "name": "id", "type": "string", "required": true, "description": "The id of the record to be updated" }, { "description": "Lead object to be updated in 1CRM", "in": "body", "name": "Lead", "required": true, "schema": { "required": [ "data" ], "properties": { "data": { "$ref": "#/definitions/Lead" }, "create": { "type": "boolean", "description": "If true, record will be created if it does not exist" } }, "type": "object" } } ], "description": "Get single Lead Object", "produces": [ "application/json" ], "responses": { "200": { "description": "always true", "schema": { "type": "object", "properties": { "result": { "type": "boolean", "description": "always true" } } } } }, "summary": "update Lead in 1CRM" }, "delete": { "operationId": "deleteSingleLead", "parameters": [ { "in": "path", "name": "id", "type": "string", "required": true, "description": "The id of the record to be deleted" } ], "produces": [ "application/json" ], "responses": { "200": { "description": "true if deleted", "schema": { "type": "object", "properties": { "result": { "type": "boolean", "description": "true if deleted" } } } } }, "summary": "delete Lead in 1CRM" } } }, "definitions": { "Lead": { "type": "object", "description": "1CRM Lead Entity", "required": [ "assigned_user", "converted", "status" ], "properties": { "id": { "type": "string" }, "deleted": { "type": "boolean" }, "date_entered": { "type": "string" }, "date_modified": { "type": "string" }, "modified_user": { "type": "string" }, "modified_user_id": { "type": "string" }, "assigned_user": { "type": "string" }, "assigned_user_id": { "type": "string" }, "created_by_user": { "type": "string" }, "created_by": { "type": "string" }, "name": { "type": "string" }, "converted": { "type": "boolean" }, "categories": { "type": "string" }, "category": { "type": "string" }, "category2": { "type": "string" }, "category3": { "type": "string" }, "category4": { "type": "string" }, "category5": { "type": "string" }, "category6": { "type": "string" }, "category7": { "type": "string" }, "category8": { "type": "string" }, "category9": { "type": "string" }, "category10": { "type": "string" }, "temperature": { "type": "string" }, "salutation": { "type": "string" }, "first_name": { "type": "string" }, "last_name": { "type": "string" }, "title": { "type": "string" }, "refered_by": { "type": "string" }, "lead_source": { "type": "string" }, "lead_source_description": { "type": "string" }, "status": { "type": "string" }, "status_description": { "type": "string" }, "department": { "type": "string" }, "reports_to": { "type": "string" }, "reports_to_id": { "type": "string" }, "do_not_call": { "type": "boolean" }, "phone_home": { "type": "string" }, "phone_home__raw": { "type": "string" }, "phone_mobile": { "type": "string" }, "phone_mobile__raw": { "type": "string" }, "phone_work": { "type": "string" }, "phone_work__raw": { "type": "string" }, "phone_other": { "type": "string" }, "phone_other__raw": { "type": "string" }, "phone_fax": { "type": "string" }, "phone_fax__raw": { "type": "string" }, "skype_id": { "type": "string" }, "email1": { "type": "string" }, "email2": { "type": "string" }, "email_opt_out": { "type": "boolean" }, "email_opt_in": { "type": "boolean" }, "email_opt_in_date": { "type": "string" }, "website": { "type": "string" }, "primary_address_street": { "type": "string" }, "primary_address_city": { "type": "string" }, "primary_address_state": { "type": "string" }, "primary_address_postalcode": { "type": "string" }, "primary_address_country": { "type": "string" }, "primary_address_statecode": { "type": "string" }, "primary_address_countrycode": { "type": "string" }, "alt_address_street": { "type": "string" }, "alt_address_city": { "type": "string" }, "alt_address_state": { "type": "string" }, "alt_address_postalcode": { "type": "string" }, "alt_address_country": { "type": "string" }, "alt_address_statecode": { "type": "string" }, "alt_address_countrycode": { "type": "string" }, "description": { "type": "string" }, "account_name": { "type": "string" }, "account_description": { "type": "string" }, "contact": { "type": "string" }, "contact_id": { "type": "string" }, "account": { "type": "string" }, "account_id": { "type": "string" }, "opportunity": { "type": "string" }, "opportunity_id": { "type": "string" }, "campaign": { "type": "string" }, "campaign_id": { "type": "string" }, "portal_active": { "type": "boolean" }, "portal_name": { "type": "string" }, "portal_app": { "type": "string" }, "invalid_email": { "type": "boolean" }, "partner": { "type": "string" }, "partner_id": { "type": "string" }, "date_converted": { "type": "string" }, "last_activity_date": { "type": "string" }, "photo": { "type": "string" }, "photo_filename": { "type": "string" }, "photo_thumb": { "type": "string" }, "consent_to_process": { "type": "boolean" }, "livechat_activity": { "type": "boolean" }, "mautic_id": { "type": "integer" }, "chat_activity": { "type": "boolean" }, "personal_info_source": { "type": "string" } } } } }