{"id":442944,"date":"2024-12-26T03:24:13","date_gmt":"2024-12-26T03:24:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=442944"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-12-26T03:24:13","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=442944","title":{"rendered":"<span>Django + Zoho CRM: \u043a\u0430\u043a \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0431\u0435\u0437 \u0433\u043e\u043b\u043e\u0432\u043d\u043e\u0439 \u0431\u043e\u043b\u0438<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u043e\u0447\u0442\u0438 \u043b\u044e\u0431\u043e\u0439 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0431\u0438\u0437\u043d\u0435\u0441, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438, \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 CRM-\u0441\u0438\u0441\u0442\u0435\u043c\u044b (Customer Relationship Management). \u0418 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e: \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0442\u0430\u043a\u0430\u044f \u0432\u044b\u0441\u043e\u043a\u0430\u044f, \u0434\u0430 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u043c. \u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u2014 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0414\u0435\u043d\u0438\u0441, \u044f Python-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 Kokoc Group. \u0423\u0436\u0435 \u043e\u043a\u043e\u043b\u043e \u0433\u043e\u0434\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0435\u0439 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u043d\u0430 Django \u0441 Zoho CRM. \u041c\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u0448\u0438\u0440\u043e\u043a\u0438\u043c \u0441\u043f\u0435\u043a\u0442\u0440\u043e\u043c \u0443\u0441\u043b\u0443\u0433, \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u044f\u0432\u043e\u043a \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u0441\u043a\u0438\u043c\u0438 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u044f\u043c\u0438 \u0432\u044b\u0441\u043e\u043a\u0438\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 Zoho CRM \u0441\u0442\u0430\u043b\u0430 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0435\u0435 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u043f\u0440\u043e\u0449\u0435 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0441\u0435 \u044d\u0442\u0430\u043f\u044b: \u043e\u0442 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0441\u0440\u0435\u0434\u044b \u0434\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0435\u0431\u0445\u0443\u043a\u043e\u0432 \u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Celery. \u0421\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0438 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430\u043c, \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u0441 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0432 CRM-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445.<\/p>\n<p>\u041e \u0447\u0435\u043c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c:<\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043a \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c CRM \u0438 Django-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 API Zoho CRM \u0447\u0435\u0440\u0435\u0437 Python.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432 Zoho CRM \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Django-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043e\u0442 \u0432\u0435\u0431\u0445\u0443\u043a\u0430 Zoho CRM, \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 Django.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Celery \u0434\u043b\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 Zoho CRM.<\/p>\n<\/li>\n<\/ul>\n<p><strong><em>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e Zoho CRM<\/em><\/strong><\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<p><em>Zoho CRM \u2014 \u044d\u0442\u043e \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 (CRM) \u043e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Zoho. \u0412 \u043d\u0435\u0439 \u0435\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043b\u0438\u0434\u0430\u043c\u0438, \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439, \u0441\u0434\u0435\u043b\u043a\u0430\u043c\u0438, \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433\u043e\u0432\u044b\u043c\u0438 \u043a\u0430\u043c\u043f\u0430\u043d\u0438\u044f\u043c\u0438, \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u043e\u0439 \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435, \u043a\u0430\u043a \u043d\u0430\u0431\u043e\u0440 \u043c\u043e\u0434\u0443\u043b\u0435\u0439:<\/em><\/p>\n<ul>\n<li>\n<p><em>\u041b\u0438\u0434\u044b (Leads) \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445.<\/em><\/p>\n<\/li>\n<li>\n<p><em>\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u044b (Contacts) \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445 \u043a\u0430\u043a \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043b\u0438\u0446\u0430\u0445.<\/em><\/p>\n<\/li>\n<li>\n<p><em>\u0410\u043a\u043a\u0430\u0443\u043d\u0442\u044b (Accounts) \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442\u0435.<\/em><\/p>\n<\/li>\n<li>\n<p><em>\u041f\u0440\u043e\u0434\u0443\u043a\u0442\u044b (Products) \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u0445 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438.<\/em><\/p>\n<\/li>\n<li>\n<p><em>\u0421\u0434\u0435\u043b\u043a\u0438 (Deals) \u2014 \u041c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u043f\u0440\u043e\u0434\u0430\u0436 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0434\u0435\u043b\u043a\u0430\u043c\u0438.<\/em><\/p>\n<\/li>\n<\/ul>\n<p><em>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b. \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u043b\u044e\u0441 \u2014 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c\u0438 Zoho: Zoho Mail, Zoho Campaigns, Zoho Desk, Zoho Books \u2014 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u043e\u043c.<\/em><\/p>\n<\/div>\n<\/details>\n<h2>\u0413\u043e\u0442\u043e\u0432\u0438\u043c CRM-\u0441\u0438\u0441\u0442\u0435\u043c\u0443<\/h2>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0443 (\u0434\u0430\u043b\u044c\u0448\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0443\u0436\u0435 \u0432 \u043d\u0435\u0439).<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/accounts.zoho.com\/\"><u>\u0417\u0430\u0432\u043e\u0434\u0438\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442<\/u><\/a> \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7f5\/395\/884\/7f5395884390df88ea81a3c863ef53d6.png\" width=\"579\" height=\"350\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7f5\/395\/884\/7f5395884390df88ea81a3c863ef53d6.png\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c Sandbox:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5e1\/8e9\/e42\/5e18e9e42a2238df1d948c47a8fd1799.png\" width=\"340\" height=\"433\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5e1\/8e9\/e42\/5e18e9e42a2238df1d948c47a8fd1799.png\"\/><\/figure>\n<\/li>\n<li>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Create New Sanbox, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0444\u043e\u0440\u043c\u0443, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Create:<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/756\/77f\/a18\/75677fa18d1f6c947d6add1bb6151f7e.png\" width=\"976\" height=\"643\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/756\/77f\/a18\/75677fa18d1f6c947d6add1bb6151f7e.png\"\/><\/figure>\n<\/li>\n<li>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Go to sunbox \u0438 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0448\u0435\u0439 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u044b (\u043e \u0447\u0435\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0444\u043b\u0430\u0433 \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435):<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d50\/109\/74a\/d5010974a065d8cdfa9d43d88ae55108.png\" width=\"1600\" height=\"342\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d50\/109\/74a\/d5010974a065d8cdfa9d43d88ae55108.png\"\/><\/figure>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043b\u044e\u0447\u0438 API<\/h4>\n<p>\u0414\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u0438.\u00a0\u0418\u0434\u0435\u043c \u0441\u044e\u0434\u0430: <a href=\"https:\/\/api-console.zoho.eu\/\"><u>https:\/\/api-console.zoho.eu\/<\/u><\/a>:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fbe\/538\/ce5\/fbe538ce52fa7a1343af1d8197353dd9.png\" width=\"1600\" height=\"632\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fbe\/538\/ce5\/fbe538ce52fa7a1343af1d8197353dd9.png\"\/><\/figure>\n<ol start=\"2\">\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c Self Client, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Create:<\/p>\n<\/li>\n<\/ol>\n<div class=\"floating-image\">\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/39b\/287\/eea\/39b287eea7d701092c99693e4c477a01.png\" width=\"493\" height=\"738\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/39b\/287\/eea\/39b287eea7d701092c99693e4c477a01.png\"\/><\/figure>\n<\/p>\n<\/div>\n<ol start=\"3\">\n<li>\n<p> \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u043e\u0442 \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u2014 \u043e\u043d\u0438 \u0435\u0449\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f:<\/p>\n<\/li>\n<\/ol>\n<div class=\"floating-image\">\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/425\/c5a\/04e\/425c5a04e39890c246201bcc17291b57.png\" width=\"456\" height=\"252\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/425\/c5a\/04e\/425c5a04e39890c246201bcc17291b57.png\"\/><\/figure>\n<\/div>\n<h4>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c Scope<\/h4>\n<p>\u0412 API Zoho, \u043e\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0443\u0442: <a href=\"https:\/\/www.zoho.com\/crm\/developer\/docs\/api\/v6\/scopes.html\"><u>https:\/\/www.zoho.com\/crm\/developer\/docs\/api\/v6\/scopes.html<\/u><\/a>).\u00a0<\/p>\n<p>\u041c\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u00abZohoCRM.modules.ALL\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u043e \u0432\u0441\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0432 Zoho CRM. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 (\u0447\u0442\u0435\u043d\u0438\u0435, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435, \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435) \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438: \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430\u043c\u0438, \u0441\u0434\u0435\u043b\u043a\u0430\u043c\u0438, \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f\u043c\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u043c.<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Create \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043a\u0430\u0431\u0438\u043d\u0435\u0442, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b04\/739\/6e8\/b047396e85092f41cb64469c287867f9.png\" width=\"938\" height=\"629\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b04\/739\/6e8\/b047396e85092f41cb64469c287867f9.png\"\/><\/figure>\n<ol start=\"2\">\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c, \u0434\u043b\u044f \u043a\u0430\u043a\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 CRM \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d: \u0434\u043b\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0438\u043b\u0438 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u044b. \u0424\u0438\u0447\u0430 \u0443\u0434\u043e\u0431\u043d\u0430\u044f: \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u0432\u0441\u0435 \u0442\u043e\u043a\u0435\u043d\u044b \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u043e\u043a\u0435\u043d\u044b<\/strong><\/p>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c POST-\u0437\u0430\u043f\u0440\u043e\u0441 <a href=\"https:\/\/accounts.zoho.eu\/oauth\/v2\/token\"><u>\u043d\u0430 \u044d\u0442\u043e\u0442 url<\/u><\/a> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u041f\u0440\u0438\u043c\u0435\u0440:<br \/>\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u044b \u043d\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 &lt;token&gt;<br \/><a href=\"https:\/\/accounts.zoho.eu\/oauth\/v2\/token?client_id=1000.XYUO2E525768VVOGWGPQNNR5CT0XLRX&amp;client_secret=d65195dda2272022ed953d27c2f3d68372323e9d59&amp;code=1000.77376d0e8a457076e50573e64%D1%819fbf04.5809cff2f4cb07c72626b4eb21e28488&amp;grant_type=authorization_code\"><u>https:\/\/accounts.zoho.eu\/oauth\/v2\/token?client_id=&lt;client_id&gt;&amp;client_secredt=&lt;client_secret&gt;&amp;code=&lt;token&gt;&amp;grant_type=authorizationcode<\/u><\/a>\u00a0\u00a0<br \/>\u0412 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442 access_token \u0438 refresh_token. \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438 \u0438\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<h2>\u0413\u043e\u0442\u043e\u0432\u0438\u043c Django-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<ul>\n<li>\n<p>Django \u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>djangorestframework \u2014 \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f API.<\/p>\n<\/li>\n<li>\n<p>requests \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>Celery \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0438, \u044f \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438:<\/p>\n<ol>\n<li>\n<p>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u044e\u0437\u0435\u0440\u0430:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">class User(AbstractBaseUser):     first_name = models.CharField(_('first name'), max_length=30,  blank=True, null=True)     last_name = models.CharField(_('last name'), max_length=30,  blank=True, null=True)     phone_number = models.CharField(_('phone number'), max_length=20,  unique=True)     email = models.EmailField(_('email address'), unique=True)      USERNAME_FIELD = 'email'     objects = UserManager()      class Meta:         verbose_name = _('User')         verbose_name_plural = _('Users')<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430: <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">class Product(models.Model):     name = models.CharField(verbose_name=_(\"Product name\"), max_length=200)     description = models.TextField(verbose_name=_(\"Product description\"), blank=True, null=True)     price = models.DecimalField(verbose_name=_(\"Price\"), decimal_places=2, max_digits=10)     zoho_product_id = models.CharField(verbose_name=_(\"Zoho product ID\"),  max_length=50, blank=True, null=True, unique=True)      def __str__(self):         return self.name<\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c ExternalResource. \u041e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Zoho CRM (Client ID, Client Secret, access_token, refresh_token):<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">class ExternalResource(models.Model):     name = models.CharField(verbose_name=_(\"Name\"), max_length=200,  unique=True)     client_id = models.CharField(verbose_name=_(\"Client ID\"),  max_length=200, null=True, blank=True)     client_secret = models.CharField(verbose_name=_(\"Client Secret\"),  max_length=200, null=True, blank=True)     token = models.CharField(verbose_name='Token', max_length=256,  null=True, blank=True, default=None)     refresh_token = models.CharField(verbose_name='Refresh token',  max_length=256, null=True, blank=True, default=None)      class Meta:         verbose_name = _('Third-party service')         verbose_name_plural = _('Third-party services')      @classmethod     def get_zoho(cls):         return cls.objects.get(name='ZohoAPI')<\/code><\/pre>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c ExternalResource \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435. \u0418 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438: <\/p>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a47\/b24\/6ac\/a47b246acdb8ae3dac14ac00f331d302.png\" width=\"632\" height=\"488\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a47\/b24\/6ac\/a47b246acdb8ae3dac14ac00f331d302.png\"\/><\/figure>\n<\/div>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 Zoho API. \u041f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b:<\/p>\n<ol>\n<li>\n<p>ExternalResourceManager \u2014 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">class ExternalResourceManager(ABC):     \"\"\"         \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a ZohoCRM.     \"\"\"      @abstractmethod     def db_object(self):         \"\"\"             \u041c\u0435\u0442\u043e\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 ExternalResource         \"\"\"         pass      @abstractmethod     def send_request(self, method, url, data, **kwargs):         \"\"\"             \u041c\u0435\u0442\u043e\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0432\u043d\u0435\u0448\u043d\u0435\u043c\u0443 \u0440\u0435\u0441\u0443\u0440\u0441\u0443         \"\"\"         pass<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>ZohoBaseManager \u2014 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 ZohoCRM API, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 ZohoCRM \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u043e\u0432:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">class ZohoBaseManager(ExternalResourceManager):      @cached_property     def db_object(self):         return ExternalResource.get_zoho()      def send_request(self, method, url, data=None, auth=False, **kwargs):         \"\"\"         \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a ZohoCRM API.         \"\"\"         if auth:             kwargs.update({\"Authorization\": f\"Zoho-oauthtoken {self.db_object.token}\"})          try:             response = requests.request(method=method, url=url, data=data, headers=kwargs)         except RequestException as e:             pass             # \u043a\u0430\u043a \u0442\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435...         return response      def handle_response(self, response):         \"\"\"         \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 API.         \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.         \"\"\"         if response is None:             raise ValueError(\"\u041e\u0442\u0432\u0435\u0442 \u043e\u0442 API \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442\")          try:             response_json = response.json()         except ValueError:             raise ValueError(\"\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u0432 JSON\")          if response.status_code != 200:             error_message = response_json.get('error', '\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430')             raise Exception(f\"\u041e\u0448\u0438\u0431\u043a\u0430 API: {error_message} (\u043a\u043e\u0434 {response.status_code})\")          return response_json       def update_token(self):         \"\"\"             \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a Zoho API \u0434\u043b\u044f  \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f token         \"\"\"         url = 'https:\/\/accounts.zoho.eu\/oauth\/v2\/token'          data = {             'client_id': self.db_object.client_id,             'client_secret': self.db_object.client_secret,             'refresh_token': self.db_object.refresh_token,             'grant_type': 'refresh_token',         }          response = self.send_request(             method='post',             url=url,             data=data         )          try:             response_json = self.handle_response(response)         except Exception as e:             # \u043a\u0430\u043a \u0442\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435...             return          new_token = response_json.get('access_token')         self.db_object.token = new_token         self.db_object.save() <\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>RegistrationDataManager \u2014 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">class RegistrationDataManager(ZohoBaseManager):      @staticmethod     def get_registration_data(user):         data = {             \"data\": [                 {                     'First_Name': user.first_name,                     'Last_Name': user.last_name,                     'Email': user.email,                     'Mobile': user.phone_number,                 }             ]         }         return data      def create_lead(self, user):         \"\"\"         \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043b\u0438\u0434\u0430 \u0432 ZohoCRM.         \"\"\"         data = self.get_registration_data(user)         json_data = json.dumps(data)         url = \"https:\/\/www.zohoapis.eu\/crm\/v2\/Leads\"         method = 'post'         response = self.send_request(method, url, json_data, auth=True)         json_response = self.handle_response(response)         # \u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 ZohoCRM (\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441,  \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c ID \u043b\u0438\u0434\u0430 \u0438 \u0442.\u0434.)<\/code><\/pre>\n<h4>\u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u043c \u0431\u0435\u0441\u043f\u0435\u0440\u0435\u0431\u043e\u0439\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a API Zoho CRM<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0443\u043f \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043a\u0435\u043d. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0437\u0430 \u043d\u0430\u0441 \u043a\u0430\u0436\u0434\u044b\u0435 10 \u043c\u0438\u043d\u0443\u0442.<\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c Celery-\u0442\u0430\u0441\u043a, \u0438 \u0432 \u043d\u0435\u043c \u2014 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 ZohoBaseManager \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 update_access_token(), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u0430. <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">@shared_task def refresh_zoho_token():     \"\"\"\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0442\u043e\u043a\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0434\u043b\u044f API Zoho CRM.\"\"\"     manager = ZohoBaseManager()     manager.update_token token()<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 settings.py (\u0442\u0430\u043c \u0431\u0443\u0434\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c, \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u0447\u0430). \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447\u0438 refresh_zoho_token \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 CELERY_BEAT_SCHEDULE:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">CELERY_BEAT_SCHEDULE = {     'refresh_zoho_token': {         'task': 'zoho_integration.tasks.refresh_zoho_token',         'schedule': crontab(minute='*\/10'),         'args': (),         'kwargs': {},         'options': {             'expires': 60.0,         },     }, }<\/code><\/pre>\n<h4>\u0427\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043b\u0438<\/h4>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p><em>task \u2014 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0443\u0442\u044c \u043a \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435.<\/em><\/p>\n<\/li>\n<li>\n<p><em>schedule \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 crontab(minute=&#8217;*\/10&#8242;), \u0442\u043e \u0435\u0441\u0442\u044c \u201c\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u0430\u0436\u0434\u044b\u0435 10 \u043c\u0438\u043d\u0443\u0442\u201d.<\/em><\/p>\n<\/li>\n<li>\n<p><em>args \u0438 kwargs \u2014 \u043f\u0443\u0441\u0442\u044b\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/em><\/p>\n<\/li>\n<li>\n<p><em>options \u2014 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u0438\u043d\u0443\u0442\u044b, \u0442\u043e \u0441\u0442\u0430\u043d\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0435\u0439 \u0438 \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u0441\u044f.<\/em><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h4>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043b\u0438\u0434\u0430 \u0432 ZohoCRM \u043f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/h4>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<ol>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Django-\u0441\u0438\u0433\u043d\u0430\u043b\u044b, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">@receiver(post_save, sender=User) def send_user_data(sender, instance, created, **kwargs):     if created:         create_zoho_lead.delay(instance.id)<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Celery-\u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043b\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Zoho CRM:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">@shared_task def create_zoho_lead(user_id: int) -&gt; None:     try:         user = User.objects.get(pk=user_id)     except User.DoesNotExist:         return      manager = RegistrationDataManager()     manager.create_lead(user)<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0435, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432 ZohoCRM.<\/p>\n<h2>\u041f\u0440\u043e\u0432\u043e\u0434\u0438\u043c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Workflow Rules<\/h2>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432 Zoho \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0438\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0434\u0443\u043a\u0442, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0441\u0432\u043e\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 Zoho CRM.<\/p>\n<h4>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430<\/h4>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0412 Zoho CRM, Workflow Rules \u2014- \u044d\u0442\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u0437\u0430\u0434\u0430\u0447\u0438. \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u043c\u043e\u0433\u0443\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430:<\/em><\/p>\n<ul>\n<li>\n<p><em>\u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c;<\/em><\/p>\n<\/li>\n<li>\n<p><em>\u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c;<\/em><\/p>\n<\/li>\n<li>\n<p><em>\u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c;<\/em><\/p>\n<\/li>\n<li>\n<p><em>\u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f, \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f, \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043a \u0437\u0430\u043f\u0438\u0441\u0438.<\/em><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0438\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0442\u044c \u043d\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043d\u0435\u043c\u0443 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0431\u0430\u0437\u0435.<\/p>\n<ol>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0443 Workflow Rules:<\/p>\n<\/li>\n<\/ol>\n<div class=\"floating-image\">\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/867\/a68\/e43\/867a68e4397a1f352a4ecc5519add940.png\" width=\"384\" height=\"445\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/867\/a68\/e43\/867a68e4397a1f352a4ecc5519add940.png\"\/><\/figure>\n<\/p>\n<\/div>\n<ol start=\"2\">\n<li>\n<p>Create Rule \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0444\u043e\u0440\u043c\u0443:<\/p>\n<\/li>\n<\/ol>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cb9\/78b\/ab8\/cb978bab876599cfde5066ffd6074c67.png\" width=\"633\" height=\"404\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cb9\/78b\/ab8\/cb978bab876599cfde5066ffd6074c67.png\"\/><\/figure>\n<\/p>\n<\/div>\n<ol start=\"3\">\n<li>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Next \u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u043c \u043d\u0430 \u044d\u0442\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dfa\/161\/692\/dfa161692762f7651936210141c4955c.png\" width=\"1600\" height=\"761\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dfa\/161\/692\/dfa161692762f7651936210141c4955c.png\"\/><\/figure>\n<ol start=\"4\">\n<li>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u0435\u043b\u0435\u043a\u0442\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Record Action. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u2014 Create or Edit \u0438 Repeat this workflow whenever a Product is edited. \u042d\u0442\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0438:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e13\/527\/e72\/e13527e727898eeb3be3faf42f4feca1.png\" width=\"1028\" height=\"418\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e13\/527\/e72\/e13527e727898eeb3be3faf42f4feca1.png\"\/><\/figure>\n<ol start=\"5\">\n<li>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Next, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c All Products (\u0442\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043a\u043e \u0432\u0441\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044f\u043c):<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/885\/cfb\/2a7\/885cfb2a792925fd97d68c6190f78212.png\" width=\"1378\" height=\"488\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/885\/cfb\/2a7\/885cfb2a792925fd97d68c6190f78212.png\"\/><\/figure>\n<ol start=\"6\">\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c, \u043a\u0430\u043a\u043e\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 Function :<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/537\/4d4\/7b9\/5374d47b9fb1c1e1b8944935f583205c.png\" width=\"1443\" height=\"650\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/537\/4d4\/7b9\/5374d47b9fb1c1e1b8944935f583205c.png\"\/><\/figure>\n<ol start=\"7\">\n<li>\n<p>\u0412 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0435\u043c\u0441\u044f \u043e\u043a\u043d\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Write your own:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5ac\/a0d\/0cc\/5aca0d0cc90cb2cc653c8f7bd96a4287.png\" width=\"854\" height=\"472\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ac\/a0d\/0cc\/5aca0d0cc90cb2cc653c8f7bd96a4287.png\"\/><\/figure>\n<ol start=\"8\">\n<li>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0444\u043e\u0440\u043c\u0443 \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Create:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/308\/227\/ac7\/308227ac702859213976df7470e328ca.png\" width=\"709\" height=\"363\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/308\/227\/ac7\/308227ac702859213976df7470e328ca.png\"\/><\/figure>\n<ol start=\"9\">\n<li>\n<p>\u041f\u043e\u043f\u0430\u0434\u0430\u0435\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/59a\/4ec\/3cf\/59a4ec3cf0f7e3918066cbd217ab9b0d.png\" width=\"1600\" height=\"685\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/59a\/4ec\/3cf\/59a4ec3cf0f7e3918066cbd217ab9b0d.png\"\/><\/figure>\n<h4>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0442\u0438\u043f\u0438\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 Zoho CRM<\/h4>\n<p>\u0427\u0442\u043e \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0435?<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u042d\u0442\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 <\/em><a href=\"https:\/\/www.zoho.com\/deluge\/help\/\"><em><u>Deluge<\/u><\/em><\/a><em>. Deluge \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f Zoho CRM \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435, \u0447\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439 \u0438\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043f\u0438\u0441\u0435\u043c. \u0412\u043e\u0442 \u043f\u0430\u0440\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432:<\/em><\/p>\n<ul>\n<li>\n<p><em>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0438 \u0446\u0438\u043a\u043b\u044b \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/em><\/p>\n<\/li>\n<li>\n<p><em>\u0412\u044b\u0437\u043e\u0432 API. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 API, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438\u043b\u0438 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/em><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0435 \u0438\u0437 Zoho CRM \u0432 \u043d\u0430\u0448\u0435 Django-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<ol>\n<li>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 ID \u0437\u0430\u043f\u0438\u0441\u0438, \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Edit Arguments:<\/p>\n<\/li>\n<\/ol>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/61a\/047\/c58\/61a047c58a1b0b7569c1d6e18573c640.png\" width=\"653\" height=\"325\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/61a\/047\/c58\/61a047c58a1b0b7569c1d6e18573c640.png\"\/><\/figure>\n<\/div>\n<ol start=\"2\">\n<li>\n<p>\u0412 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0435\u043c\u0441\u044f \u043e\u043a\u043d\u0435, \u0432 \u043f\u043e\u043b\u0435 Argument Name \u0437\u0430\u0434\u0430\u0435\u043c \u0438\u043c\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430. \u0412 \u043f\u043e\u043b\u0435 Argument Value \u0432\u0432\u043e\u0434\u0438\u043c \u00ab#\u00bb. \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c Product Id. \u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Save:<\/p>\n<\/li>\n<\/ol>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b8c\/68d\/958\/b8c68d958bb2cc4ba3d54a0636e68b72.png\" width=\"903\" height=\"523\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b8c\/68d\/958\/b8c68d958bb2cc4ba3d54a0636e68b72.png\"\/><\/figure>\n<\/p>\n<\/div>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c ID \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0418 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u0443\u044e \u0438\u043b\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/295\/42d\/aa4\/29542daa46175ab290f97b33f1eff2af.png\" width=\"1312\" height=\"699\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/295\/42d\/aa4\/29542daa46175ab290f97b33f1eff2af.png\"\/><\/figure>\n<h4>\u041d\u0430\u043f\u0438\u0448\u0435\u043c view, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441<\/h4>\n<p>View<\/p>\n<pre><code class=\"python\">class ZohoProductView(APIView)     serializer_class = ZohoProductSerializer     permission_classes = (CheckZohoTokenPermission,)      def post(self, request):         serializer = self.serializer_class(data=request.data)         serializer.is_valid(raise_exception=True)         sync_product.delay(data=serializer.validated_data)         return Response(serializer.data, status=status.HTTP_202_ACCEPTED<\/code><\/pre>\n<p>Serializer<\/p>\n<pre><code class=\"python\">class ZohoProductSerializer(serializers.Serializer):     zoho_product_id = serializers.CharField()     name = serializers.CharField()     description = serializers.CharField()     price = serializers.DecimalField(max_digits=10, decimal_places=2)<\/code><\/pre>\n<p>Permission<\/p>\n<pre><code class=\"python\">class CheckZohoTokenPermission(BasePermission):      def has_permission(self, request, view):         if request.META.get(\"HTTP_ZOHO_REQUEST_AUTH_TOKEN\") == settings.ZOHO_REQUEST_AUTH_TOKEN:             return True<\/code><\/pre>\n<p>Celery Task<\/p>\n<pre><code class=\"python\">@shared_task def sync_product(data):     zoho_product_id = data.get(\"zoho_product_id\")     product = Product.objects.filter(zoho_product_id=zoho_product_id)     if product.exists():         product.update(**data)     else:         Product.objects.create(**data)<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432 Zoho CRM, \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 Products \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043b\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c, \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043d\u0443\u0436\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043d\u0430\u0448 Django API-endpoint, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0435 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0438\u0445 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432 Celery-\u0437\u0430\u0434\u0430\u0447\u0443 sync_product. \u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e zoho_product_id.\u00a0<\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u043d\u043e\u0432\u044f\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u2014 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 Product \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.\u00a0<\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c Zoho CRM \u0438 Django-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u044b \u0432 \u043e\u0431\u0435\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445. <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u042f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c Zoho CRM \u0441 Django-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445 \u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u0445. \u041d\u043e \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u043b\u0438\u0448\u044c \u043d\u0430\u0447\u0430\u043b\u043e, \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Zoho CRM \u2014 \u044d\u0442\u043e \u0433\u0438\u0431\u043a\u0438\u0439 \u0438 \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u0434 \u043b\u044e\u0431\u044b\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438. \u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0439\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0431\u0438\u0437\u043d\u0435\u0441 \u0435\u0449\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435.<\/p>\n<p>\u0418 \u043f\u0430\u0440\u0430 \u0441\u043e\u0432\u0435\u0442\u043e\u0432 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a:<\/p>\n<ul>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u043a\u043e\u0434. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0438 \u0432\u0430\u043c, \u0438 \u0432\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043b\u0443\u0447\u0448\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0438 \u043b\u0435\u0433\u043a\u043e \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0439\u0442\u0435. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u0442 \u0435\u0435 \u0440\u0430\u0431\u043e\u0442\u0443.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0418\u0437\u0443\u0447\u0438\u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e Zoho CRM \u0438 Django. \u0412 \u043d\u0438\u0445 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. <\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/861430\/\"> https:\/\/habr.com\/ru\/articles\/861430\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u043e\u0447\u0442\u0438 \u043b\u044e\u0431\u043e\u0439 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0431\u0438\u0437\u043d\u0435\u0441, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438, \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 CRM-\u0441\u0438\u0441\u0442\u0435\u043c\u044b (Customer Relationship Management). \u0418 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e: \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0442\u0430\u043a\u0430\u044f \u0432\u044b\u0441\u043e\u043a\u0430\u044f, \u0434\u0430 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u043c. \u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u2014 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0414\u0435\u043d\u0438\u0441, \u044f Python-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 Kokoc Group. \u0423\u0436\u0435 \u043e\u043a\u043e\u043b\u043e \u0433\u043e\u0434\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0435\u0439 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u043d\u0430 Django \u0441 Zoho CRM. \u041c\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u0448\u0438\u0440\u043e\u043a\u0438\u043c \u0441\u043f\u0435\u043a\u0442\u0440\u043e\u043c \u0443\u0441\u043b\u0443\u0433, \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u044f\u0432\u043e\u043a \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u0441\u043a\u0438\u043c\u0438 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u044f\u043c\u0438 \u0432\u044b\u0441\u043e\u043a\u0438\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 Zoho CRM \u0441\u0442\u0430\u043b\u0430 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0435\u0435 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u043f\u0440\u043e\u0449\u0435 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0441\u0435 \u044d\u0442\u0430\u043f\u044b: \u043e\u0442 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0441\u0440\u0435\u0434\u044b \u0434\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0435\u0431\u0445\u0443\u043a\u043e\u0432 \u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Celery. \u0421\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0438 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430\u043c, \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u0441 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0432 CRM-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445.<\/p>\n<p>\u041e \u0447\u0435\u043c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c:<\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043a \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c CRM \u0438 Django-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 API Zoho CRM \u0447\u0435\u0440\u0435\u0437 Python.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432 Zoho CRM \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Django-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043e\u0442 \u0432\u0435\u0431\u0445\u0443\u043a\u0430 Zoho CRM, \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 Django.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Celery \u0434\u043b\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 Zoho CRM.<\/p>\n<\/li>\n<\/ul>\n<p><strong><em>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e Zoho CRM<\/em><\/strong><\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<p><em>Zoho CRM \u2014 \u044d\u0442\u043e \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 (CRM) \u043e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Zoho. \u0412 \u043d\u0435\u0439 \u0435\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043b\u0438\u0434\u0430\u043c\u0438, \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439, \u0441\u0434\u0435\u043b\u043a\u0430\u043c\u0438, \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433\u043e\u0432\u044b\u043c\u0438 \u043a\u0430\u043c\u043f\u0430\u043d\u0438\u044f\u043c\u0438, \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u043e\u0439 \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435, \u043a\u0430\u043a \u043d\u0430\u0431\u043e\u0440 \u043c\u043e\u0434\u0443\u043b\u0435\u0439:<\/em><\/p>\n<ul>\n<li>\n<p><em>\u041b\u0438\u0434\u044b (Leads) \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445.<\/em><\/p>\n<\/li>\n<li>\n<p><em>\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u044b (Contacts) \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445 \u043a\u0430\u043a \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043b\u0438\u0446\u0430\u0445.<\/em><\/p>\n<\/li>\n<li>\n<p><em>\u0410\u043a\u043a\u0430\u0443\u043d\u0442\u044b (Accounts) \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442\u0435.<\/em><\/p>\n<\/li>\n<li>\n<p><em>\u041f\u0440\u043e\u0434\u0443\u043a\u0442\u044b (Products) \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u0445 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438.<\/em><\/p>\n<\/li>\n<li>\n<p><em>\u0421\u0434\u0435\u043b\u043a\u0438 (Deals) \u2014 \u041c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u043f\u0440\u043e\u0434\u0430\u0436 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0434\u0435\u043b\u043a\u0430\u043c\u0438.<\/em><\/p>\n<\/li>\n<\/ul>\n<p><em>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b. \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u043b\u044e\u0441 \u2014 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c\u0438 Zoho: Zoho Mail, Zoho Campaigns, Zoho Desk, Zoho Books \u2014 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u043e\u043c.<\/em><\/p>\n<\/div>\n<\/details>\n<h2>\u0413\u043e\u0442\u043e\u0432\u0438\u043c CRM-\u0441\u0438\u0441\u0442\u0435\u043c\u0443<\/h2>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0443 (\u0434\u0430\u043b\u044c\u0448\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0443\u0436\u0435 \u0432 \u043d\u0435\u0439).<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/accounts.zoho.com\/\"><u>\u0417\u0430\u0432\u043e\u0434\u0438\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442<\/u><\/a> \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438:<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c Sandbox:<\/p>\n<figure class=\"\"><\/figure>\n<\/li>\n<li>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Create New Sanbox, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0444\u043e\u0440\u043c\u0443, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Create:<\/p>\n<figure class=\"bordered full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Go to sunbox \u0438 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0448\u0435\u0439 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u044b (\u043e \u0447\u0435\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0444\u043b\u0430\u0433 \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435):<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><\/figure>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043b\u044e\u0447\u0438 API<\/h4>\n<p>\u0414\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u0438.\u00a0\u0418\u0434\u0435\u043c \u0441\u044e\u0434\u0430: <a href=\"https:\/\/api-console.zoho.eu\/\"><u>https:\/\/api-console.zoho.eu\/<\/u><\/a>:<\/p>\n<figure class=\"full-width\"><\/figure>\n<ol start=\"2\">\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c Self Client, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Create:<\/p>\n<\/li>\n<\/ol>\n<div class=\"floating-image\">\n<figure class=\"float\"><\/figure>\n<\/p>\n<\/div>\n<ol start=\"3\">\n<li>\n<p> \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u043e\u0442 \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u2014 \u043e\u043d\u0438 \u0435\u0449\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f:<\/p>\n<\/li>\n<\/ol>\n<div class=\"floating-image\">\n<figure class=\"float\"><\/figure>\n<\/div>\n<h4>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c Scope<\/h4>\n<p>\u0412 API Zoho, \u043e\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0443\u0442: <a href=\"https:\/\/www.zoho.com\/crm\/developer\/docs\/api\/v6\/scopes.html\"><u>https:\/\/www.zoho.com\/crm\/developer\/docs\/api\/v6\/scopes.html<\/u><\/a>).\u00a0<\/p>\n<p>\u041c\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u00abZohoCRM.modules.ALL\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u043e \u0432\u0441\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0432 Zoho CRM. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 (\u0447\u0442\u0435\u043d\u0438\u0435, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435, \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435) \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438: \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430\u043c\u0438, \u0441\u0434\u0435\u043b\u043a\u0430\u043c\u0438, \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f\u043c\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u043c.<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Create \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043a\u0430\u0431\u0438\u043d\u0435\u0442, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><\/figure>\n<ol start=\"2\">\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c, \u0434\u043b\u044f \u043a\u0430\u043a\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 CRM \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d: \u0434\u043b\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0438\u043b\u0438 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u044b. \u0424\u0438\u0447\u0430 \u0443\u0434\u043e\u0431\u043d\u0430\u044f: \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u0432\u0441\u0435 \u0442\u043e\u043a\u0435\u043d\u044b \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u043e\u043a\u0435\u043d\u044b<\/strong><\/p>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c POST-\u0437\u0430\u043f\u0440\u043e\u0441 <a href=\"https:\/\/accounts.zoho.eu\/oauth\/v2\/token\"><u>\u043d\u0430 \u044d\u0442\u043e\u0442 url<\/u><\/a> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u041f\u0440\u0438\u043c\u0435\u0440:<br \/>\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u044b \u043d\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 &lt;token&gt;<br \/><a href=\"https:\/\/accounts.zoho.eu\/oauth\/v2\/token?client_id=1000.XYUO2E525768VVOGWGPQNNR5CT0XLRX&amp;client_secret=d65195dda2272022ed953d27c2f3d68372323e9d59&amp;code=1000.77376d0e8a457076e50573e64%D1%819fbf04.5809cff2f4cb07c72626b4eb21e28488&amp;grant_type=authorization_code\"><u>https:\/\/accounts.zoho.eu\/oauth\/v2\/token?client_id=&lt;client_id&gt;&amp;client_secredt=&lt;client_secret&gt;&amp;code=&lt;token&gt;&amp;grant_type=authorizationcode<\/u><\/a>\u00a0\u00a0<br \/>\u0412 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442 access_token \u0438 refresh_token. \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438 \u0438\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<h2>\u0413\u043e\u0442\u043e\u0432\u0438\u043c Django-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<ul>\n<li>\n<p>Django \u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>djangorestframework \u2014 \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f API.<\/p>\n<\/li>\n<li>\n<p>requests \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>Celery \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0438, \u044f \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438:<\/p>\n<ol>\n<li>\n<p>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u044e\u0437\u0435\u0440\u0430:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">class User(AbstractBaseUser):     first_name = models.CharField(_('first name'), max_length=30,  blank=True, null=True)     last_name = models.CharField(_('last name'), max_length=30,  blank=True, null=True)     phone_number = models.CharField(_('phone number'), max_length=20,  unique=True)     email = models.EmailField(_('email address'), unique=True)      USERNAME_FIELD = 'email'     objects = UserManager()      class Meta:         verbose_name = _('User')         verbose_name_plural = _('Users')<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430: <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">class Product(models.Model):     name = models.CharField(verbose_name=_(\"Product name\"), max_length=200)     description = models.TextField(verbose_name=_(\"Product description\"), blank=True, null=True)     price = models.DecimalField(verbose_name=_(\"Price\"), decimal_places=2, max_digits=10)     zoho_product_id = models.CharField(verbose_name=_(\"Zoho product ID\"),  max_length=50, blank=True, null=True, unique=True)      def __str__(self):         return self.name<\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c ExternalResource. \u041e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Zoho CRM (Client ID, Client Secret, access_token, refresh_token):<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">class ExternalResource(models.Model):     name = models.CharField(verbose_name=_(\"Name\"), max_length=200,  unique=True)     client_id = models.CharField(verbose_name=_(\"Client ID\"),  max_length=200, null=True, blank=True)     client_secret = models.CharField(verbose_name=_(\"Client Secret\"),  max_length=200, null=True, blank=True)     token = models.CharField(verbose_name='Token', max_length=256,  null=True, blank=True, default=None)     refresh_token = models.CharField(verbose_name='Refresh token',  max_length=256, null=True, blank=True, default=None)      class Meta:         verbose_name = _('Third-party service')         verbose_name_plural = _('Third-party services')      @classmethod     def get_zoho(cls):         return cls.objects.get(name='ZohoAPI')<\/code><\/pre>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c ExternalResource \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435. \u0418 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438: <\/p>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><\/figure>\n<\/div>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 Zoho API. \u041f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b:<\/p>\n<ol>\n<li>\n<p>ExternalResourceManager \u2014 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">class ExternalResourceManager(ABC):     \"\"\"         \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a ZohoCRM.     \"\"\"      @abstractmethod     def db_object(self):         \"\"\"             \u041c\u0435\u0442\u043e\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 ExternalResource         \"\"\"         pass      @abstractmethod     def send_request(self, method, url, data, **kwargs):         \"\"\"             \u041c\u0435\u0442\u043e\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0432\u043d\u0435\u0448\u043d\u0435\u043c\u0443 \u0440\u0435\u0441\u0443\u0440\u0441\u0443         \"\"\"         pass<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>ZohoBaseManager \u2014 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 ZohoCRM API, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 ZohoCRM \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u043e\u0432:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">class ZohoBaseManager(ExternalResourceManager):      @cached_property     def db_object(self):         return ExternalResource.get_zoho()      def send_request(self, method, url, data=None, auth=False, **kwargs):         \"\"\"         \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a ZohoCRM API.         \"\"\"         if auth:             kwargs.update({\"Authorization\": f\"Zoho-oauthtoken {self.db_object.token}\"})          try:             response = requests.request(method=method, url=url, data=data, headers=kwargs)         except RequestException as e:             pass             # \u043a\u0430\u043a \u0442\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435...         return response      def handle_response(self, response):         \"\"\"         \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 API.         \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.         \"\"\"         if response is None:             raise ValueError(\"\u041e\u0442\u0432\u0435\u0442 \u043e\u0442 API \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442\")          try:             response_json = response.json()         except ValueError:             raise ValueError(\"\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u0432 JSON\")          if response.status_code != 200:             error_message = response_json.get('error', '\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430')             raise Exception(f\"\u041e\u0448\u0438\u0431\u043a\u0430 API: {error_message} (\u043a\u043e\u0434 {response.status_code})\")          return response_json       def update_token(self):         \"\"\"             \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a Zoho API \u0434\u043b\u044f  \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f token         \"\"\"         url = 'https:\/\/accounts.zoho.eu\/oauth\/v2\/token'          data = {             'client_id': self.db_object.client_id,             'client_secret': self.db_object.client_secret,             'refresh_token': self.db_object.refresh_token,             'grant_type': 'refresh_token',         }          response = self.send_request(             method='post',             url=url,             data=data         )          try:             response_json = self.handle_response(response)         except Exception as e:             # \u043a\u0430\u043a \u0442\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435...             return          new_token = response_json.get('access_token')         self.db_object.token = new_token         self.db_object.save() <\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>RegistrationDataManager \u2014 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">class RegistrationDataManager(ZohoBaseManager):      @staticmethod     def get_registration_data(user):         data = {             \"data\": [                 {                     'First_Name': user.first_name,                     'Last_Name': user.last_name,                     'Email': user.email,                     'Mobile': user.phone_number,                 }             ]         }         return data      def create_lead(self, user):         \"\"\"         \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043b\u0438\u0434\u0430 \u0432 ZohoCRM.         \"\"\"         data = self.get_registration_data(user)         json_data = json.dumps(data)         url = \"https:\/\/www.zohoapis.eu\/crm\/v2\/Leads\"         method = 'post'         response = self.send_request(method, url, json_data, auth=True)         json_response =<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-442944","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/442944","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=442944"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/442944\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=442944"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=442944"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=442944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}