Add or Update Asset
This method adds or updates assets. Existing values will be retained when updating existing assets and the parameters have been omitted.
Query String Parameters
Name | Type | Description | Required |
---|---|---|---|
Action | String | AssetSave | Required |
AssetId | Int | Unique Id of the asset. | Required |
AssetRegistration | String | The registration number of the asset. | Required |
AssetType | Int/String | The type of asset to be created. Parameter can be either the "int" or "string" value, where: 1 = Vehicle or 2 = Trailer. | Required |
VehicleType | Int/String | Use method 'VehicleTypes' for supported values. | Required |
GroupId | Int | Provide either the Group Id or Group Name. At least one must be provided when creating an asset. | Required |
GroupName | String | Provide either the Group Id or Group Name. At least one must be provided when creating an asset. | Required |
Make | String | Asset make. | Required |
Model | String | Asset model. | Required |
Year | Numeric | Asset year. | Required |
OdometerUnit | String | String to represent the Odometer where: mi = miles (default) km = kilometer. | Required |
Reference | String | The internal reference of the asset. | Required |
UsedForJobs | Bool | 1 = true, 0 = false | Required |
ResourceId | Int | Id of the fixed resource (if required). Provide the ResourceId or ResourceReference to associate a fixed resource. | Required |
ResourceReference | String | Reference of the fixed (resource). | Required |
CostPerKm | Decimal | Cost per kilometer. | Required |
CostPerMileCurrency | String | Cost per mile currency. | Required |
CostPerDay | Decimal | Cost per day. | Required |
CostPerDayCurrency | String | Cost per day currency. | Required |
Co2 | Double | Not implemented - provided for future support. | Required |
IdlingFuelConsumption | Double | Not implemented - provided for future support. | Required |
Attributes | <id,date> | AttributeId,AttributeDate - use method 'Attributes' for support values. Multiple instances of the parameter can be provided. | Required |
WorksheetsForVehicleChecks | Not implemented - provided for future support. | Required | |
VehicleTypeForDefects | Not implemented - provided for future support. | Required | |
MaxRPM | Short | Maximum RPM | Required |
IconName | String | Default icon name is "rig". Use method 'AssetIcons' for supported values. | Required |
cust_custom field name | Pass cust_ followed by the caption of an existing custom field. | Optional | |
ContactGroup | String(50) | Name of the contact group. If the group doesn’t already exist it will be created. The contactGroup parameter must be supplied if custom fields are included in the request. | Optional |
ContactParentReference | String(40) | Reference you use in your system to identify contact’s parent. | Optional |
ContactParentId | Int | Internal BigChange ContactParentId. | Optional |
ContactReference | String(40) | Key you use in your system to identify the contact. | Optional |
ContactId | Int | Internal BigChange contact reference. | Optional |
ContactStreet | String(100) | Address information. If you have your address information in one whole string you can only specify the parameter "Street". | Optional |
ContactPostcode | String(10) | Post Code. | Optional |
ContactTown | String(100) | Town. | Optional |
ContactCountry | String(50) | Country. | Optional |
ContactLat | Double | Latitude. | Optional |
ContactLng | Double | Longitude. | Optional |
ContactRadiusMeter | Int | Radius in meters. | Optional |
ContactPerson | String(30) | Person you are in touch with at the contact. | Optional |
ContactPhone | String(30) | Phone number of the person working at that contact. Must be in International format. No space E.g. +447954012012 Please ensure you encode the Phone Number. | Optional |
ContactEmail | String(100) | Email of that person. | Optional |
ContactExtra | String(255) | Any extra bit of info you want to save. | Optional |
ContactReplaceSameRef | Int | When = 1, a contact with the specified reference will be updated with the new info. 1 or 0. Default 0. | Optional |
cust_custom field name | String | Pass cust_ followed by the caption of an existing custom field. | Optional |
ContactFirstName | String | First name of the contact. | Optional |
ContactLastName | String | Last name of the contact. | Optional |
ContactAccountReference | String | The financial account reference. | Optional |
ContactAccountType | Int | Contact's account type | Optional |
ContactExtraUpdate | Int | Update contact’s extra info. | Optional |
CreditLimit | String | Contact’s credit limit. | Optional |
CreditLimitCurrency | String | Currency of the credit limit. | Optional |
ContactExtraDelay2Pay | String | An extra parameter for Delay2Pay. | Optional |
ContactOnStop | int | Pass the relevant integer value to set the contacts on stop status. ContactOnStop values 0 = None , 1 = OnStop , 2 = Credit Limit On Stop. | Optional |
ContactOnStopReason | String | Sets the ContactOnStop Reason. | Optional |
ContactWhat3Words | String | Set location using What3Words . Will over-write any polygon data, and replace with a radius (default or supplied). | Optional |
note
At a minimum either the parameter "ContactStreet", or the coordinates ("ContactLat" & "ContactLng"), are required.
Response Codes
Example
- Request
- Response
Request URL
https://webservice.bigchange.com/v01/services.ashx?action=AssetSave&AssetRegistration=XXX 123Z&AssetType=1&VehicleType=4&GroupId=1046&Reference=AAABBBCCC
Response Data
{ "Code": 0, "Result": { "AssetId": 226330, "AssetRegistration": "XXX 123Z", "AssetReference": "AAABBBCCC" } }