Estimate

  • 15.5
This article is may not be up to date with the latest stable release of M4.

Description

The Estimate endpoint provides the API consumer with access to methods pertaining to estimates and related data objects. The endpoint allows consumers to load estimate data, add new estimates , and update estimates .

Methods

URL base/CRM/Estimate/Specification
Action GET
Description Returns a data dictionary that details the available web service methods related to the Estimate endpoint.
Parameters None
 Returns  A JSON object with method descriptions
Sample Return Object
[
    {
        "HttpAction": "Get",
        "MethodName": "GetEstimate",
        "Description": "Returns the record for a single 'Estimate' given the passed in ID value (see Path).",
        "Path": "/Estimate/GetEstimate/25032"
    },
    {
        "HttpAction": "Get",
        "MethodName": "GetEstimatesByLead",
        "Description": "Returns the collection of 'Estimate' given the passed in Lead ID value (see Path).",
        "Path": "/Estimate/GetEstimatesByLead/25032"
    },
    {
        "HttpAction": "Get",
        "MethodName": "GetEstimatesByOpportunity",
        "Description": "Returns the collection of 'Estimate' given the passed in Opportunity ID value (see Path).",
        "Path": "/Estimate/GetEstimatesByOpportunity/25032"
    },
    {
        "HttpAction": "Get",
        "MethodName": "GetEstimatesByContact",
        "Description": "Returns the collection of 'Estimate' given the passed in Contact ID value (see Path).",
        "Path": "/Estimate/GetEstimatesByContact/25032"
    },
    {
        "HttpAction": "Post",
        "MethodName": "AddEstimate",
        "Description": "Creates the record for a single 'Estimate' and returns the Estimate object",
        "Format": {
            "Name": "Estimate",
            "Description": "f6d983ae-21bb-433a-a599-2b0c54e315aa",
            "OpportunityID": 555,
            "CostPortfolioID": 269,
            "StatusID": 983,
            "TypeID": 948,
            "ContactID": 485,
            "CreatedOn": "2018-06-13T11:25:23.6416217-04:00",
            "CreatedBy": "Mapcom"
        }
    },
    {
        "HttpAction": "Post",
        "MethodName": "UpdateEstimate",
        "Description": "Updates the record for a single 'Estimate' and returns the Estimate object",
        "Format": {
            "ID": 109,
            "Name": "Estimate",
            "Description": "6d7b0005-9768-4ee7-a34a-a3dc682d5d87",
            "OpportunityID": 905,
            "CostPortfolioID": 306,
            "StatusID": 467,
            "TypeID": 713,
            "ContactID": 398,
            "CreatedOn": "2018-06-13T11:25:23.6426351-04:00",
            "CreatedBy": "Mapcom"
        }
    },
    {
        "HttpAction": "Get",
        "MethodName": "DeleteEstimate",
        "Description": "Deletes the record for a single 'Estimate' given the passed in ID value (see Path).",
        "Path": "/Estimate/DeleteEstimate/25032"
    }
]
URL base/CRM/Estimate/GetEstimate/ID
Action GET
Description Returns an Estimate object when given an ID of a valid estimate in the M4 database.
Parameters
Name Required? Type Description
ID Yes Integer An integer value representing the ID of a estimate in the M4 database.
Returns A JSON Estimate data object
Sample Return Object
{
     "ID": 109,
     "Name": "Estimate",
     "Description": "6d7b0005-9768-4ee7-a34a-a3dc682d5d87",
     "OpportunityID": 905,
     "CostPortfolioID": 306,
     "StatusID": 467,
     "TypeID": 713,
     "ContactID": 398,
     "CreatedOn": "2018-06-13T11:25:23.6426351-04:00",
     "CreatedBy": "Mapcom"
}
URL base/CRM/Estimate/GetEstimatesByLead/ID
Action GET
Description Returns a collection of Estimate objects when given an ID of a valid lead in the M4 database.
Parameters
Name Required? Type Description
ID Yes Integer An integer value representing the ID of a lead in the M4 database.
Returns A list of JSON Estimate data objects
Sample Return Object
[
     {
          "ID": 109,
          "Name": "Estimate",
          "Description": "6d7b0005-9768-4ee7-a34a-a3dc682d5d87",
          "OpportunityID": 905,
          "CostPortfolioID": 306,
          "StatusID": 467,
          "TypeID": 713,
          "ContactID": 398,
          "CreatedOn": "2018-06-13T11:25:23.6426351-04:00",
          "CreatedBy": "Mapcom"
     },
     {
          "ID": 110,
          "Name": "Estimate",
          "Description": "f6d983ae-21bb-433a-a599-2b0c54e315aa",
          "OpportunityID": 555,
          "CostPortfolioID": 269,
          "StatusID": 983,
          "TypeID": 948,
          "ContactID": 485,
          "CreatedOn": "2018-06-13T11:25:23.6416217-04:00",
          "CreatedBy": "Mapcom"
     }
]
URL base/CRM/Estimate/GetEstimatesByOpportunity/ID
Action GET
Description Returns a collection of Estimate objects when given an ID of a valid opportunity in the M4 database.
Parameters
Name Required? Type Description
ID Yes Integer An integer value representing the ID of a opportunity in the M4 database.
Returns A list of JSON Estimate data objects
Sample Return Object
[
     {
          "ID": 109,
          "Name": "Estimate",
          "Description": "6d7b0005-9768-4ee7-a34a-a3dc682d5d87",
          "OpportunityID": 905,
          "CostPortfolioID": 306,
          "StatusID": 467,
          "TypeID": 713,
          "ContactID": 398,
          "CreatedOn": "2018-06-13T11:25:23.6426351-04:00",
          "CreatedBy": "Mapcom"
     },
     {
          "ID": 110,
          "Name": "Estimate",
          "Description": "f6d983ae-21bb-433a-a599-2b0c54e315aa",
          "OpportunityID": 905,
          "CostPortfolioID": 269,
          "StatusID": 983,
          "TypeID": 948,
          "ContactID": 485,
          "CreatedOn": "2018-06-13T11:25:23.6416217-04:00",
          "CreatedBy": "Mapcom"
     }
]
URL base/CRM/Estimate/GetEstimatesByContact/ID
Action GET
Description Returns a collection of Estimate objects when given an ID of a valid contact in the M4 database.
Parameters
Name Required? Type Description
ID Yes Integer An integer value representing the ID of a contact in the M4 database.
Returns A list of JSON Estimate data objects
Sample Return Object
[
     {
          "ID": 109,
          "Name": "Estimate",
          "Description": "6d7b0005-9768-4ee7-a34a-a3dc682d5d87",
          "OpportunityID": 905,
          "CostPortfolioID": 306,
          "StatusID": 467,
          "TypeID": 713,
          "ContactID": 398,
          "CreatedOn": "2018-06-13T11:25:23.6426351-04:00",
          "CreatedBy": "Mapcom"
     },
     {
          "ID": 110,
          "Name": "Estimate",
          "Description": "f6d983ae-21bb-433a-a599-2b0c54e315aa",
          "OpportunityID": 905,
          "CostPortfolioID": 269,
          "StatusID": 983,
          "TypeID": 948,
          "ContactID": 398,
          "CreatedOn": "2018-06-13T11:25:23.6416217-04:00",
          "CreatedBy": "Mapcom"
     }
]
URL base/CRM/Estimate/AddEstimate
Action POST
Description Adds the specified estimate object and returns a the newly created estimate object.
Parameters
Name Required? Type Description
Name Yes String The full name of the estimate.
Description No String The description of the estimate.
OpportunityID Yes Integer The opportunity ID of the estimate.
CostPortfolioID Yes Integer The cost portfolio ID of the estimate.
StatusID Yes Integer The status ID of the estimate.
TypeID Yes Integer The type ID of the estimate.
ContactID No Integer The contact ID of the estimate.
CreatedOn Yes DateTime The time the estimate was created.
CreatedBy Yes String The user who created the estimate.
Sample JSON Package
{
     "Name": "Estimate",
     "Description": "6d7b0005-9768-4ee7-a34a-a3dc682d5d87",
     "OpportunityID": 905,
     "CostPortfolioID": 306,
     "StatusID": 467,
     "TypeID": 713,
     "ContactID": 398,
     "CreatedOn": "2018-06-13T11:25:23.6426351-04:00",
     "CreatedBy": "Mapcom"
}
Returns A JSON Estimate data object
Sample Return Object
{
     "ID": 109,
     "Name": "Estimate",
     "Description": "6d7b0005-9768-4ee7-a34a-a3dc682d5d87",
     "OpportunityID": 905,
     "CostPortfolioID": 306,
     "StatusID": 467,
     "TypeID": 713,
     "ContactID": 398,
     "CreatedOn": "2018-06-13T11:25:23.6426351-04:00",
     "CreatedBy": "Mapcom"
}
Business Rules
Any violations of these business rules result in an appropriate error message being returned to the API consumer.
  • Name: must not be null
  • OpportunityID: must not be null
  • CostPortfolioID: must not be null
  • StatusID: must not be null
  • TypeID: must not be null
  • CreatedOn: must not be null
  • CreatedBy: must not be null
URL base/CRM/Estimate/UpdateEstimate
Action POST
Description Updates the specified estimate object and returns a the newly updated estimate object.
Parameters
Name Required? Type Description
ID Yes Integer The ID of the estimate.
Name Yes String The full name of the estimate.
Description No String The description of the estimate.
OpportunityID Yes Integer The opportunity ID of the estimate.
CostPortfolioID Yes Integer The cost portfolio ID of the estimate.
StatusID Yes Integer The status ID of the estimate.
TypeID Yes Integer The type ID of the estimate.
ContactID No Integer The contact ID of the estimate.
CreatedOn Yes DateTime The time the estimate was created.
CreatedBy Yes String The user who created the estimate.
Sample JSON Package
{
     "ID": 109,
     "Name": "Estimate",
     "Description": "6d7b0005-9768-4ee7-a34a-a3dc682d5d87",
     "OpportunityID": 905,
     "CostPortfolioID": 306,
     "StatusID": 467,
     "TypeID": 713,
     "ContactID": 398,
     "CreatedOn": "2018-06-13T11:25:23.6426351-04:00",
     "CreatedBy": "Mapcom"
}
Returns A JSON Estimate data object
Sample Return Object
{
     "ID": 109,
     "Name": "Estimate",
     "Description": "6d7b0005-9768-4ee7-a34a-a3dc682d5d87",
     "OpportunityID": 905,
     "CostPortfolioID": 306,
     "StatusID": 467,
     "TypeID": 713,
     "ContactID": 398,
     "CreatedOn": "2018-06-13T11:25:23.6426351-04:00",
     "CreatedBy": "Mapcom"
}
Business Rules
Any violations of these business rules result in an appropriate error message being returned to the API consumer.
  • ID: must not be null
  • Name: must not be null
  • OpportunityID: must not be null
  • CostPortfolioID: must not be null
  • StatusID: must not be null
  • TypeID: must not be null
  • CreatedOn: must not be null
  • CreatedBy: must not be null
URL base/CRM/Estimate/DeleteEstimate/ID
Action GET
Description Deletes an Estimate object when given an ID of a valid estimate in the M4 database.
Parameters
Name Required? Type Description
ID Yes Integer An integer value representing the ID of a estimate in the M4 database.
Returns A JSON data object
Sample Return Object
{
  "Message": "The Estimate with ID [55] was deleted successfully."
}

Was this article helpful?

Related Articles