Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

This method updates leads. A single lead can be updated by each call and only if it is not with status Won or Lost. Fields which are not specified are not updated at all. Fields which are specified as null will be set as null.

...

Name

Type

Description

token

String

The token retrieved from the login method

lead_identifier
(mandatory)
Lead Identifier

The identifier of the Lead to be updated. The allowed lead identifier fields are the following:

Include Page
V4:lead_identifier
V4:lead_identifier

contact_email

(optional)

StringThe email address of the contact that will be specified on the updated lead

contact_phone

(optional)

String

The phone of the contact that will be specified on the updated lead

Tip

Available from CRM.COM R11.1.0

description

(optional)

StringA description of the lead

probability_to_win

(optional)

NumberThe probability to win the retrieved lead which can vary from 0 to 100

importance

(optional)

Lead Importance

The importance related with the leads that should be returned as a result. The allowed lead importance fields are the following: IMPORTANCE1, IMPORTANCE2, IMPORTANCE3, IMPORTANCE4, IMPORTANCE5, CUSTOM1, CUSTOM2, CUSTOM3

priority

(optional)

Lead Priority

The priority related with the leads that should be returned as a result. The allowed lead priority fields are the following: 1, 2, 3, 4, 5, 6

target_amount

(optional)

NumberThe amount that is predicted to be gained when winning the retrieved lead

status_identifier

(optional)

Lead Status Identifier

The status of the lead. The allowed lead status identifier fields are the following:

Include Page
V4:lead_status_identifier
V4:lead_status_identifier

lost_reason_identifier

(mandatory on conditions)

Lead Lost Reason Identifier

The reason that the lead was lost. This information is mandatory and applicable only if the lead is updated in a status classified as lost. The allowed lead lost reason identifier fields are the following:

Include Page
V4:lead_lost_reason_identifier
V4:lead_lost_reason_identifier

Tip

Deprecated from CRM.COM R11.1.0

billing_address_identifier

(mandatory on conditions)

Address identifier

The address that will be used as the accounts receivable billing address in case that the lead is updated to a status classified as won. This information is mandatory and applicable only if the lead is updated in a status classified as won. The allowed address identifier fields are the following:

Include Page
V4:address_identifier
V4:address_identifier

Tip

Deprecated from CRM.COM R11.1.0.

category_identifier

(optional)

Lead Category Identifier

The category of the lead. The allowed lead category identifier fields are the following:

Include Page
V4:lead_category_identifier
V4:lead_category_identifier

owned_by_group_identifier
(optional)

The identifier of the owned by group information

The owned by group information of the lead. The allowed group identifier fields are the following:

Include Page
V4:group_identifier
V4:group_identifier

privacy_level_identifier
(optional)

The identifier of the privacy level

The privacy level of the lead. The allowed privacy level identifier fields are the following:

Include Page
V4:privacy_level_identifier
V4:privacy_level_identifier

lead_ownerUser Identifier

The user which owns the lead. The allowed user identifier fields are the following:

Include Page
V4:user_identifier
V4:user_identifier

Tip

Available from CRM.COM R15.0.0

udf_string_1 

(optional)

String

User Defined Field of type String

udf_string_2 

(optional)

String

User Defined Field of type String

udf_string_3 

(optional)

String

User Defined Field of type String

udf_string_4 

(optional)

String

User Defined Field of type String

udf_string_5

(optional)

String

User Defined Field of type String

udf_string_6 

(optional)

String

User Defined Field of type String

udf_string_7

(optional)

String

User Defined Field of type String

udf_string_8

(optional)

String

User Defined Field of type String

udf_float_1

(optional)

Float

User Defined Field of type Float

udf_float_2

(optional)

Float

User Defined Field of type Float

udf_float_3

(optional)

Float

User Defined Field of type Float

udf_float_4

(optional)

Float

User Defined Field of type Float

udf_date_1 

(optional)

Date

User Defined Field of type Date

udf_date_2 

(optional)

Date

User Defined Field of type Date

udf_date_3

(optional)

Date

User Defined Field of type Date

udf_date_4

(optional)

Date

User Defined Field of type Date

start_date
(optional)

DateThe date that the lead started

expected_completion_date
(optional)

DateThe date that the lead is expected to be completed. It is automatically calculated if estimate completion time is specified.
estimated_completion_time
(optional)
Time Period ObjectThe time that is estimated to complete the lead , measured in minutes, hours, days, weeks, years. It is automatically calculated if expected completion date is specified.

source

(optional)

Lead SourceInformation related with the source of the lead
assigned_to
(optional)
Assigned to objectThe assignment information for the lead

competitors_set

(optional)

Set of Lead Competitors

A lists of all possible competitors that can reach the same Lead for the same product/goal.

Include Page
V4:Web API - Updating Sets
V4:Web API - Updating Sets

users_set

(optional)

Set of Lead Users

A list of users that are set as the team involved with the lead

Include Page
V4:Web API - Updating Sets
V4:Web API - Updating Sets

services_set

(optional)

Set of lead Services Objects

A list of services for which the lead was taken for

Include Page
V4:Web API - Updating Sets
V4:Web API - Updating Sets

physical_goods_set

(optional)

Set of lead Physical Goods Objects

A list of the physical goods for which the lead was taken for

Include Page
V4:Web API - Updating Sets
V4:Web API - Updating Sets

subscription_packages

(optional)

Set of lead Subscription Packages Objects

A list of the subscription packages for which the lead was taken for

Tip

Available from CRM.COM R14

fields_set

(optional)

List of Strings, comma separatedA list of fields that should be included in the results. If not specified then all the available fields will be returned

...

Expand
titleExample 2

HTTP Method: POST

 

Request{{server}}/crmapi/rest/v2/leads/update

Body:

Code Block
languagejs
{
    "token":"{{token}}",
    "lead_identifier" : {"number" : "127"},
    "status_identifier" : { "name" : "Reach"},
    "billing_address_identifier" : { "TYPE" : "HOME"},
    "lead_products_set" :
    [
        {
            "action" : "add",
           "lead_product_identifier":{ "product_identifier" : { "code" : "123"}}
        },
        
         {
            "action" : "remove",
              "lead_product_identifier":{"product_identifier" : { "code" : "MAD MAX"}}
        },
         {
            "action" : "add",
              "lead_product_identifier":{"product_type_identifier" : { "name" : "Additional Services"}}
        },
         {
            "action" : "remove",
             "lead_product_identifier":{ "product_type_identifier" : { "name" : "Add-ons"}}
        },
         {
            "action" : "add",
              "lead_product_identifier":{"product_brand_identifier" : { "name" : "Corso Shoes"}}
        },
         {
            "action" : "remove",
              "lead_product_identifier":{"product_brand_identifier" : { "name" : "API's Check Update"}}
        },
         {
            "action" : "add",
              "lead_product_identifier":{"product_family_identifier" : { "name" : "Channels"}}
        },
         {
            "action" : "remove",
              "lead_product_identifier":{"product_family_identifier" : { "name" : "Dry Stock"}}
        }
    ],
    "subscription_package_identifier": { "name" : "Simple Package"},
    "competitors_set" :
    [
        {
            "action" : "add",
            "competitor_identifier" : { "name" : "MagnaQuest"}
        }
    ]
}

 

Response:

Code Block
languagejs
 {
    "data": {
        "target_amount": null,
        "contact_phone": null,
        "log_information": {
            "created_by_unit": {
                "alternative_code": "adminunit",
                "group_name": "Main Group",
                "community_name": "Community",
                "name": "Admin Unit",
                "description": "admin unit",
                "id": "1"
            },
            "updated_by_unit": {
                "alternative_code": "adminunit",
                "group_name": "Main Group",
                "community_name": "Community",
                "name": "Admin Unit",
                "description": "admin unit",
                "id": "1"
            },
            "created_date": "2018-01-22T10:02:58",
            "updated_date": "2018-01-22T10:30:42",
            "updated_by_user": {
                "person_name": "CRM COM",
                "id": "1",
                "email": null,
                "username": "MPAdministrator"
            },
            "created_by_user": {
                "person_name": "CRM COM",
                "id": "1",
                "email": null,
                "username": "MPAdministrator"
            }
        },
        "importance": "IMPORTANCE1",
        "subscription_package": {
            "subscription_package": {
                "alternative_code": "SP",
                "name": "Simple Package",
                "description": null,
                "id": "0015B6F5645F4454A442051E823E3B4D",
                "classification": "PACKAGE"
            }
        },
        "lead_source": {
            "name": "test",
            "type": "CUSTOM2"
        },
        "owned_by_group": {
            "alternative_code": "MG",
            "community_name": "Community",
            "name": "Main Group",
            "description": "Main Group",
            "id": "1"
        },
        "description": null,
        "contact_information": {
            "company_profile": null,
            "company_name": null,
            "name": null,
            "last_name": "Panagi",
            "id": "12F12B2F406A42E699A7E98646ADD1FB",
            "life_cycle_state": "FINANCIAL",
            "middle_name": null,
            "title": null,
            "type": "PERSON",
            "first_name": "Kokos",
            "demographics": {
                "name_day": {
                    "month": null,
                    "day": null
                },
                "id_number": "9896546",
                "gender": null,
                "country_of_residence": {
                    "alternative_code": "IRN",
                    "three_character_code": null,
                    "name": "IRAN (ISLAMIC REPUBLIC OF)",
                    "id": "231",
                    "two_character_code": null
                },
                "date_of_birth": {
                    "month": null,
                    "year": null,
                    "day": null
                },
                "industry_sector": null,
                "passport_number": null,
                "industry": null,
                "social_security_number": null,
                "id_issued_by_country": null,
                "passport_issued_by_country": null
            }
        },
        "type": {
            "alternative_code": "NC",
            "name": "New Customer",
            "description": null,
            "id": "696C0E5F273B4D548F875F63F9DE77C2"
        },
        "udf_date_2": null,
        "udf_date_1": null,
        "products_set": [
            {
                "product_family": null,
                "product": null,
                "product_type": {
                    "meter_reading_type": null,
                    "service_type": "TERMED",
                    "used_for_provisioning": true,
                    "alternative_code": "AS",
                    "udr_type": null,
                    "composition_method": "FLAT",
                    "name": "Additional Services",
                    "description": null,
                    "id": "C8321F0BCA8A4051857BC35CEEE41555",
                    "classification": "SERVICES",
                    "physical_good_type": null
                },
                "id": "8FBA0B4E1AA6490592992CEB438AAFB6",
                "product_brand": null
            },
            {
                "product_family": null,
                "product": null,
                "product_type": null,
                "id": "9A29EC3ED67F4030B4EA57F2D4C0CAD1",
                "product_brand": {
                    "alternative_code": "CS",
                    "name": "Corso Shoes",
                    "description": null,
                    "id": "5A917782ACA648B3BEAF417D1E64C43F"
                }
            },
            {
                "product_family": {
                    "code": "CH",
                    "name": "Channels",
                    "description": null,
                    "id": "5432773B865246E3B10A47CD130183C7"
                },
                "product": null,
                "product_type": null,
                "id": "77D222EA6C4E4169B3560F5CA926FAE4",
                "product_brand": null
            },
            {
                "product_family": null,
                "product": {
                    "code": "123",
                    "product_type": {
                        "meter_reading_type": null,
                        "service_type": null,
                        "used_for_provisioning": true,
                        "alternative_code": "STB",
                        "udr_type": null,
                        "composition_method": "FLAT",
                        "name": "SET TOP BOX",
                        "description": "SET TOP BOX",
                        "id": "E8BA9A6F34A24019A89892D5B3ACD9DF",
                        "classification": "PHYSICALGOODS",
                        "physical_good_type": "TRACEABLE"
                    },
                    "alternative_code": "1_13",
                    "description": "desc",
                    "id": "99E46901A95B4E31A60BBE67280F2522",
                    "priority_level": null
                },
                "product_type": null,
                "id": "1D08C46265F44BC68BF8C8BD0AD43FB7",
                "product_brand": null
            }
        ],
        "udf_date_4": null,
        "contact_email": null,
        "udf_date_3": null,
        "number": "127",
        "udf_float_3": null,
        "udf_float_4": null,
        "estimated_completion_time": {
            "time_period_uot": "MONTHS",
            "time_period_value": 1
        },
        "probability_to_win": null,
        "id": "4DF94747AE1C4DA4916DD5012F245DCE",
        "udf_float_1": null,
        "udf_float_2": null,
        "start_date": "2018-01-22T10:02:58",
        "assigned_to": {
            "unit": {
                "alternative_code": "adminunit",
                "group_name": "Main Group",
                "community_name": "Community",
                "name": "Admin Unit",
                "description": "admin unit",
                "id": "1"
            },
            "user": {
                "person_name": "CRM COM",
                "id": "1",
                "email": null,
                "username": "MPAdministrator"
            }
        },
        "udf_string_2": null,
        "udf_string_3": null,
        "udf_string_4": null,
        "actual_completion_date": null,
        "udf_string_5": null,
        "privacy_level": null,
        "users_set": [],
        "udf_string_1": null,
        "accounts_receivable": {
            "number": "ACR0000000094",
            "name": "ACR0000000094 Kokos Panagi",
            "id": "F3A5B0ED175A4A1AA6A418CBD9FF8A0F",
            "life_cycle_state": "ACTIVE",
            "account_owner": {
                "company_profile": null,
                "company_name": null,
                "name": null,
                "last_name": "Panagi",
                "id": "12F12B2F406A42E699A7E98646ADD1FB",
                "life_cycle_state": "FINANCIAL",
                "middle_name": null,
                "title": null,
                "type": "PERSON",
                "first_name": "Kokos",
                "demographics": {
                    "name_day": {
                        "month": null,
                        "day": null
                    },
                    "id_number": "9896546",
                    "gender": null,
                    "country_of_residence": {
                        "alternative_code": "IRN",
                        "three_character_code": null,
                        "name": "IRAN (ISLAMIC REPUBLIC OF)",
                        "id": "231",
                        "two_character_code": null
                    },
                    "date_of_birth": {
                        "month": null,
                        "year": null,
                        "day": null
                    },
                    "industry_sector": null,
                    "passport_number": null,
                    "industry": null,
                    "social_security_number": null,
                    "id_issued_by_country": null,
                    "passport_issued_by_country": null
                }
            }
        },
        "life_cycle_state": "PENDING",
        "priority": 1,
        "time_to_completion": {
            "time_period_uot": "MONTHS",
            "time_period_value": 1
        },
        "lost_reason": null,
        "competitors_set": [
            {
                "competitor": {
                    "website": null,
                    "name": "MagnaQuest",
                    "description": null,
                    "id": "640A12797E964BFC99F8AF0EA538EEEA"
                },
                "id": "A83933A180EF4547B3D21093147F8A51"
            }
        ],
        "time_overdue": {
            "time_period_uot": null,
            "time_period_value": null
        },
        "category": {
            "code": "NC",
            "name": "New Customer",
            "description": null,
            "id": "35EB799C52F14A8984FE2F397A852A78"
        },
        "udf_string_6": null,
        "expected_completion_date": "2018-02-22T10:02:58",
        "udf_string_7": null,
        "udf_string_8": null,
        "status": {
            "alternative_code": "RCH",
            "name": "Reach",
            "description": null,
            "id": "E9977550B9AA4DB78E08379B0F744E5A",
            "life_cycle_state": "PENDING"
        }
    },
    "status": {
        "code": "OK",
        "description": "",
        "message": ""
    }
}