- 15.5
Description
The EstimateType endpoint provides the API consumer with access to methods pertaining to estimate types and related data objects. The endpoint allows consumers to load estimate types , add new estimate types , and update estimate types .
Methods
- Specification
- GetEstimateType
- GetEstimateTypes
- AddEstimateType
- UpdateEstimateType
- DeleteEstimateType
| URL | base/CRM/EstimateType/Specification |
|---|---|
| Action | GET |
| Description | Returns a data dictionary that details the available web service methods related to the EstimateType endpoint. |
| Parameters | None |
| Returns | A JSON object with method descriptions |
| Sample Return Object | |
[
{
"HttpAction": "Get",
"MethodName": "GetEstimateType",
"Description": "Returns the record for a single 'EstimateType' given the passed in ID value (see Path).",
"Path": "/EstimateType/GetEstimateType/25032"
},
{
"HttpAction": "Get",
"MethodName": "GetEstimateTypes",
"Description": "Returns all the 'EstimateType' records.",
"Path": "/EstimateType/GetEstimateTypes"
},
{
"HttpAction": "Post",
"MethodName": "AddEstimateType",
"Description": "Creates the record for a single 'EstimateType' and returns the EstimateType object",
"Format": {
"Name": "Residential",
"Description": "residential type"
}
},
{
"HttpAction": "Post",
"MethodName": "UpdateEstimateType",
"Description": "Updates the record for a single 'EstimateType' and returns the EstimateType object",
"Format": {
"ID": 1,
"Name": "Residential",
"Description": "residential type"
}
},
{
"HttpAction": "Get",
"MethodName": "DeleteEstimateType",
"Description": "Deletes the record for a single 'EstimateType' given the passed in ID value (see Path).",
"Path": "/EstimateType/DeleteEstimateType/25032"
}
]
|
|
| URL | base/CRM/EstimateType/GetEstimateType/ID | ||
|---|---|---|---|
| Action | GET | ||
| Description | Returns a EstimateType object when given an ID of a valid estimate type in the M4 database. | ||
| Parameters | |||
| Name | Required? | Type | Description |
| ID | Yes | Integer | An integer value representing the ID of a estimate type in the M4 database. |
| Returns | A JSON EstimateType data object | ||
| Sample Return Object | |||
{
"ID": 1,
"Name": "Residential",
"Description": "residential type"
}
|
|||
| URL | base/CRM/EstimateType/GetEstimateTypes | ||
|---|---|---|---|
| Action | GET | ||
| Description | Returns a collection of all the EstimateType objects in the M4 database. | ||
| Parameters | None | ||
| Returns | A list of JSON EstimateType data objects | ||
| Sample Return Object | |||
[
{
"ID": 1,
"Name": "Residential",
"Description": "residential type"
},
{
"ID": 2,
"Name": "Commercial",
"Description": "commercial type"
}
]
|
|||
| URL | base/CRM/EstimateType/AddEstimateType | ||
|---|---|---|---|
| Action | POST | ||
| Description | Adds the specified EstimateType object and returns the newly added EstimateType object. | ||
| Parameters | |||
| Name | Required? | Type | Description |
| Name | Yes | String | The name of the estimate type. |
| Description | No | String | The description of the estimate type. |
| Sample JSON Package | |||
{
"Name": "Residential",
"Description": "residential type"
}
|
|||
| Returns | A JSON EstimateType data object | ||
| Sample Return Object | |||
{
"ID": 1,
"Name": "Residential",
"Description": "residential type"
}
|
|||
| Business Rules | |||
Any violations of these business rules result in an appropriate error message being returned to the API consumer.
|
|||
| URL | base/CRM/EstimateType/UpdateEstimateType | ||
|---|---|---|---|
| Action | POST | ||
| Description | Updates the specified EstimateType object and returns the newly updated EstimateType object. | ||
| Parameters | |||
| Name | Required? | Type | Description |
| ID | Yes | Integer | The ID of the estimate type. |
| Name | Yes | String | The name of the estimate type. |
| Description | No | String | The description of the estimate type. |
| Sample JSON Package | |||
{
"ID": 1,
"Name": "Residential",
"Description": "residential type"
}
|
|||
| Returns | A JSON EstimateType data object | ||
| Sample Return Object | |||
{
"ID": 1,
"Name": "Residential",
"Description": "residential type"
}
|
|||
| Business Rules | |||
Any violations of these business rules result in an appropriate error message being returned to the API consumer.
|
|||
| URL | base/CRM/EstimateType/DeleteEstimateType/ID | ||
|---|---|---|---|
| Action | GET | ||
| Description | Deletes an EstimateType object when given an ID of a valid estimate type in the M4 database. | ||
| Parameters | |||
| Name | Required? | Type | Description |
| ID | Yes | Integer | An integer value representing the ID of a estimate type in the M4 database. |
| Returns | A JSON data object | ||
| Sample Return Object | |||
{
"Message": "The EstimateType with ID [55] was deleted successfully."
}
|
|||