Kaizen #69 - Scoring Rules[Part 2]

Kaizen #69 - Scoring Rules[Part 2]

Hello everyone!
Welcome back to this week's Kaizen post!
In continuation to our previous post, this week we will discuss activating/deactivating a scoring rule, cloning, and getting the score of a record from a module.

Activating/deactivating a scoring rule

Use this API to activate or deactivate an existing scoring rule. 

Request URL: {api-domain}/crm/v4/settings/automation/scoring_rules/{rule_id}/actions/activate
Use the Get Scoring Rules API to get the ID of the rule you want to activate or deactivate.
Request Method: PUT(to activate)/DELETE(to deactivate)
Scope: ZohoCRM.settings.scoring_rules.ALL (or) ZohoCRM.settings.scoring_rules.UPDATE(to activate a rule) (or)
ZohoCRM.settings.scoring_rules.DELETE(to deactivate a rule)
Supported Modules: Leads, Contacts, Accounts, Deals, and custom

Response of activating a scoring rule


Response of deactivating a scoring rule


Note

  • A scoring rule becomes active right after creation(if you give "active:true" while creation), but gets applied to the module's records only after you execute it.
  • After you deactivate a scoring rule, the scores of the records that were already calculated are retained, while new scores will not be calculated.

Cloning a scoring rule

You can clone a scoring rule instead of creating one from scratch through this API. 

Request URL: {api-domain}/crm/v4/settings/automation/scoring_rules/{rule_id}/actions/clone
Use the Get Scoring Rules API to get the ID of the rule you want to clone from.
Request Method: POST
Scope: ZohoCRM.settings.scoring_rules.ALL/CREATE
Supported Modules: Leads, Contacts, Accounts, Deals, and custom

Response



Getting a record's score

After configuring a scoring rule and executing it, you can use this API to view the score of a record in a module.

Request URL: {api-domain}/crm/v4/{module_api_name}/{record_id}/Entity_Scores__s
Use the Get Records API to get the ID of the record.
Request Method: GET
Scope: ZohoCRM.settings.scoring_rules.ALL/GET
Supported Modules: Leads, Contacts, Accounts, Deals, and custom
Parameters: fields(mandatory)
Possible values: Positive_Score, Negative_Score, Touch_Point_Score, Touch_Point_Positive_Score, Touch_Point_Negative_Score, Score, Scoring_Rule, Entity
You can also use other field API names in the module.

Response

{
    "data": [
        {
            "Entity": {
                "module": {
                    "api_name": "Leads",
                    "id": "3652397000000002175"
                },
                "name": "scoring rules test",
                "id": "3652397000010473001"
            },
            "Positive_Score": 9,
            "Touch_Point_Score": -1,
            "Score": 6,
            "Negative_Score": -2,
            "Touch_Point_Negative_Score": -10,
            "Scoring_Rule": {
                "name": null,
                "id": "3652397000006074001"
            },
            "id": "3652397000010473011",
            "Touch_Point_Positive_Score": 9
        }
    ],
    "info": {
        "per_page": 200,
        "next_page_token": null,
        "count": 1,
        "page": 1,
        "previous_page_token": null,
        "page_token_expiry": null,
        "more_records": false
    }
}


Key
Description
Entity
JSON object
The JSON object that gives the details of the module, name and ID of the record. This object is returned in the response only when you include the value Entity for the fields parameter.
Positive_Score
integer
The positive score of the record based on the scoring rule. This value is returned in the response when you include "fields=Positive_Score" in the parameters
Touch_Point_Positive_Score
integer
The total positive scores obtained from all the touchpoints. This value is returned in the response when you include "fields=Touch_Point_Positive_Score" in the parameters.Touch_Point_Negative_Score
integer
Touch_Point_Negative_Score
integer
The total negative scores obtained from all the touchpoints. This value is returned in the response when you include "fields=Touch_Point_Negative_Score" in the parameters.
Negative_Score
integer
The negative score of the record based on the scoring rule. This is returned for "fields=Negative_Score".
Touch_Point_Score
integer
The difference between positive and negative touchpoint scores. This is returned for "fields=Touch_Point_Score".
Score
integer
The overall score of the record. This is returned for "fields=Score".
Scoring_Rule
JSON object
The API name and ID of the scoring rule that was applied on the record. This is returned for "fields=Scoring_Rule".

Note that for modules other than Leads and Contacts, the touchpoint scores will always be null.


We hope you found this post useful. 
Get in touch with us at support@zohocrm.com if you have any questions, or let us know in the comments.
We will see you next week with another interesting post.



Cheers!


    Access your files securely from anywhere







                            Zoho Developer Community





                                                  Use cases

                                                  Make the most of Zoho Desk with the use cases.

                                                   
                                                    

                                                  eBooks

                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                                   
                                                    

                                                  Videos

                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                                   
                                                    

                                                  Webinar

                                                  Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                   
                                                    
                                                  • Desk Community Learning Series


                                                  • Meetups


                                                  • Ask the Experts


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner




                                                            • Sticky Posts

                                                            • Kaizen #197: Frequently Asked Questions on GraphQL APIs

                                                              🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
                                                            • Kaizen #198: Using Client Script for Custom Validation in Blueprint

                                                              Nearing 200th Kaizen Post – 1 More to the Big Two-Oh-Oh! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
                                                            • Celebrating 200 posts of Kaizen! Share your ideas for the milestone post

                                                              Hello Developers, We launched the Kaizen series in 2019 to share helpful content to support your Zoho CRM development journey. Staying true to its spirit—Kaizen Series: Continuous Improvement for Developer Experience—we've shared everything from FAQs
                                                            • Kaizen #193: Creating different fields in Zoho CRM through API

                                                              🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
                                                            • Client Script | Update - Introducing Commands in Client Script!

                                                              Have you ever wished you could trigger Client Script from contexts other than just the supported pages and events? Have you ever wanted to leverage the advantage of Client Script at your finger tip? Discover the power of Client Script - Commands! Commands


                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator Resources



                                                                                      Zoho CRM Resources

                                                                                      • CRM Community Learning Series

                                                                                        CRM Community Learning Series


                                                                                      • Kaizen

                                                                                        Kaizen

                                                                                      • Functions

                                                                                        Functions

                                                                                      • Meetups

                                                                                        Meetups

                                                                                      • Kbase

                                                                                        Kbase

                                                                                      • Resources

                                                                                        Resources

                                                                                      • Digest

                                                                                        Digest

                                                                                      • CRM Marketplace

                                                                                        CRM Marketplace

                                                                                      • MVP Corner

                                                                                        MVP Corner







                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now


                                                                                            Zoho Show Resources


                                                                                              Zoho Writer Writer

                                                                                              Get Started. Write Away!

                                                                                              Writer is a powerful online word processor, designed for collaborative work.

                                                                                                Zoho CRM コンテンツ








                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方