{"_id":"55421a4a6592e60d00027c1b","category":{"_id":"554213dacbc48d0d001544ef","pages":["55421a3f6592e60d00027c19","55421a4a6592e60d00027c1b","55421a776592e60d00027c1e","55421e4d6592e60d00027c24","55478a479a48800d00c6e537","555379d8d402b92300cee2f5"],"project":"54ad7b1d9219922100751796","version":"5505581f728deb23005ec0f4","__v":6,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-30T11:36:58.428Z","from_sync":false,"order":2,"slug":"partners-api","title":"Partners API"},"__v":16,"user":"54d350b5eefae10d0016cfbc","project":"54ad7b1d9219922100751796","version":{"_id":"5505581f728deb23005ec0f4","forked_from":"54ad7b1d9219922100751799","project":"54ad7b1d9219922100751796","__v":4,"createdAt":"2015-03-15T09:59:59.748Z","releaseDate":"2015-03-15T09:59:59.748Z","categories":["55055820728deb23005ec0f5","55055820728deb23005ec0f6","554213dacbc48d0d001544ef","55421a598aeff51700a20db6","55a64fe680c8a30d00b325e0"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-04-30T12:04:26.475Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"Lead Injection API allows directory admins to send new leads or messages to any account in their system. It is usually used to connect existing lead sources such as 3rd party apps or online forms to vCita. \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Authentication\"\n}\n[/block]\nLead Injection API requires a token that can be provided to partners and directory admins. \n**To receive a token please contact us at partners:::at:::vcita.com.**\n\nThe token should be added as an HTTP header to every API call, see example below:\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl https://api.vcita.com/v1/partners/leads -H Authorization: Token token=\\\"aaaabbbbccccddddeeeeffff11112222\\\"\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Injecting a Lead\"\n}\n[/block]\nLead will be injected to a specific account (identified by the business_id parameter).\nWhen injecting a lead, the system will either create a new client entry for the business or add a message connected to an existing client. A new conversation with a message inside will always be created. \n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST https://api.vcita.com/v1/partners/leads\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\nLead Attributes:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"**General Information**\",\n    \"0-1\": \"\",\n    \"2-0\": \"notifications\",\n    \"2-1\": \"A list of notifications to send after processing of the lead. \\nPossible values: \\\"auto-reply\\\" (thank you email to the end user), \\\"email\\\" (notify the business owner) or \\\"sms\\\" (text notification to the business owner). None if empty.\",\n    \"1-0\": \"business_id\",\n    \"1-1\": \"A unique identifier of the business. Can be the vCita uuid or nickname. REQUIRED\",\n    \"3-0\": \"**Client Information**\",\n    \"4-0\": \"identifier_type\",\n    \"4-1\": \"Defines which unique identifier will be used to search for an existing lead or create a new one. Possible values: \\\"email\\\" or \\\"unique_id\\\" REQUIRED\",\n    \"5-0\": \"email\",\n    \"5-1\": \"Lead email address. Unique per business. IMMUTABLE\",\n    \"6-0\": \"unique_id\",\n    \"6-1\": \"Lead unique id. Unique per business. IMMUTABLE\",\n    \"7-0\": \"phone\",\n    \"7-1\": \"Lead phone number. IMMUTABLE\",\n    \"8-0\": \"first_name\",\n    \"8-1\": \"Lead first name. Mandatory for a new lead. IMMUTABLE\",\n    \"9-0\": \"last_name\",\n    \"9-1\": \"Lead last name. IMMUTABLE\",\n    \"11-0\": \"**Message Information**\",\n    \"12-0\": \"request_title\",\n    \"12-1\": \"Request title. Will also be the created conversation title. REQUIRED\",\n    \"13-0\": \"request_data\",\n    \"13-1\": \"The information that the end user has provided. (e.g the labels and values of a contact form) key=value; key=value. \\nPlease note: this information is visible both to the business owner and to the end user. Therefore it should not contain private business information.\",\n    \"14-0\": \"system_message\",\n    \"14-1\": \"A message displayed to the business owner to introduce the lead. May contain links.\",\n    \"15-0\": \"source\",\n    \"15-1\": \"Will be displayed to the business owner as the lead source\",\n    \"16-0\": \"source_url\",\n    \"16-1\": \"The URL of the page where the lead was created.\",\n    \"10-0\": \"opt_in\",\n    \"10-1\": \"Send \\\"true\\\" if lead opted in for promotions.\\nMake sure the \\\"opt-in\\\" client card field is added to the client card under Settings>Client card.\"\n  },\n  \"cols\": 2,\n  \"rows\": 17\n}\n[/block]\nIMMUTABLE  Means it is set once per client on creation and can't be changed using the API afterwards.\n\nReturn Codes:\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"201 OK\",\n    \"0-1\": \"The lead has been processed correctly. Return Value: {uid: new_engagement_uid}\",\n    \"1-0\": \"401 Unauthorized\",\n    \"1-1\": \"Failed authenticating with the token. See content for more information\",\n    \"2-0\": \"422 Unprocessable Entity\",\n    \"2-1\": \"Bad parameter(s). See content for more information.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Usage Example\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -H 'Authorization: Token token=\\\"token\\\"' -i -X POST -d \\n'request_title=Contact Request&business_id=business_id&identifier_type=email &email=johndoe@gmail.com&first_name=John&last_name=Doe&phone=050-1234567& source=Law Pages&source_url=http://www.lawpages.com&system_message=New contact request from LawPages&request_data[e-mail]=johndoe@gmail.com&request_data[name]=John Doe&request_data[Cell Phone]=050-1234567&request_data[Address]=Country rode 19, Arizona&request_data[Message]=Im interested in a good real-estate attorney&notifications[]=email&notifications[]=auto_reply&notifications[]=sms' https://api.vcita.com/v1/partners/leads\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"lead-injection","type":"basic","title":"Lead Injection"}
Lead Injection API allows directory admins to send new leads or messages to any account in their system. It is usually used to connect existing lead sources such as 3rd party apps or online forms to vCita. [block:api-header] { "type": "basic", "title": "Authentication" } [/block] Lead Injection API requires a token that can be provided to partners and directory admins. **To receive a token please contact us at partners@vcita.com.** The token should be added as an HTTP header to every API call, see example below: [block:code] { "codes": [ { "code": "curl https://api.vcita.com/v1/partners/leads -H Authorization: Token token=\"aaaabbbbccccddddeeeeffff11112222\"", "language": "curl" } ] } [/block] [block:api-header] { "type": "basic", "title": "Injecting a Lead" } [/block] Lead will be injected to a specific account (identified by the business_id parameter). When injecting a lead, the system will either create a new client entry for the business or add a message connected to an existing client. A new conversation with a message inside will always be created. [block:code] { "codes": [ { "code": "POST https://api.vcita.com/v1/partners/leads", "language": "http" } ] } [/block] Lead Attributes: [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "0-0": "**General Information**", "0-1": "", "2-0": "notifications", "2-1": "A list of notifications to send after processing of the lead. \nPossible values: \"auto-reply\" (thank you email to the end user), \"email\" (notify the business owner) or \"sms\" (text notification to the business owner). None if empty.", "1-0": "business_id", "1-1": "A unique identifier of the business. Can be the vCita uuid or nickname. REQUIRED", "3-0": "**Client Information**", "4-0": "identifier_type", "4-1": "Defines which unique identifier will be used to search for an existing lead or create a new one. Possible values: \"email\" or \"unique_id\" REQUIRED", "5-0": "email", "5-1": "Lead email address. Unique per business. IMMUTABLE", "6-0": "unique_id", "6-1": "Lead unique id. Unique per business. IMMUTABLE", "7-0": "phone", "7-1": "Lead phone number. IMMUTABLE", "8-0": "first_name", "8-1": "Lead first name. Mandatory for a new lead. IMMUTABLE", "9-0": "last_name", "9-1": "Lead last name. IMMUTABLE", "11-0": "**Message Information**", "12-0": "request_title", "12-1": "Request title. Will also be the created conversation title. REQUIRED", "13-0": "request_data", "13-1": "The information that the end user has provided. (e.g the labels and values of a contact form) key=value; key=value. \nPlease note: this information is visible both to the business owner and to the end user. Therefore it should not contain private business information.", "14-0": "system_message", "14-1": "A message displayed to the business owner to introduce the lead. May contain links.", "15-0": "source", "15-1": "Will be displayed to the business owner as the lead source", "16-0": "source_url", "16-1": "The URL of the page where the lead was created.", "10-0": "opt_in", "10-1": "Send \"true\" if lead opted in for promotions.\nMake sure the \"opt-in\" client card field is added to the client card under Settings>Client card." }, "cols": 2, "rows": 17 } [/block] IMMUTABLE Means it is set once per client on creation and can't be changed using the API afterwards. Return Codes: [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "0-0": "201 OK", "0-1": "The lead has been processed correctly. Return Value: {uid: new_engagement_uid}", "1-0": "401 Unauthorized", "1-1": "Failed authenticating with the token. See content for more information", "2-0": "422 Unprocessable Entity", "2-1": "Bad parameter(s). See content for more information." }, "cols": 2, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Usage Example" } [/block] [block:code] { "codes": [ { "code": "curl -H 'Authorization: Token token=\"token\"' -i -X POST -d \n'request_title=Contact Request&business_id=business_id&identifier_type=email &email=johndoe@gmail.com&first_name=John&last_name=Doe&phone=050-1234567& source=Law Pages&source_url=http://www.lawpages.com&system_message=New contact request from LawPages&request_data[e-mail]=johndoe@gmail.com&request_data[name]=John Doe&request_data[Cell Phone]=050-1234567&request_data[Address]=Country rode 19, Arizona&request_data[Message]=Im interested in a good real-estate attorney&notifications[]=email&notifications[]=auto_reply&notifications[]=sms' https://api.vcita.com/v1/partners/leads", "language": "curl" } ] } [/block]