PUT | /customers/{Id} | Update an existing customer | Updates an existing user if the current logged in user is allowed to update the specified customer. Users are only allowed to update their own info, administrators are allowed to update customer beloning to their company (if no account is created, email is added, if so the customer can only update it's own info). |
---|
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
CompanyId | query | Guid? | No | Enter the company and id for the customer, if blank company id and you are an admin, your company id will be used. |
Id | path | Guid | Yes | customer id |
Firstname | body | string | No | |
Lastname | body | string | No | |
Phone | body | string | No | |
body | string | No | ||
CustomFields | body | List<AddCustomField> | No | If Custom Fields are added to the customer, here you will send the id and the value for each custom field to be updated |
AccessKeys | body | List<AddUserAccessKey> | No | List of Access Keys |
AccessKeysToDelete | body | List<DeleteUserAccessKey> | No | |
SubscribedToNewsletter | body | bool? | No | |
InvoiceAddress | body | InvoiceAddress | No |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Id | form | int | No | |
Value | form | string | No |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Id | form | Guid? | No | |
CompanyId | form | Guid? | No | |
AccessKeyTypeId | form | int | No | |
Value | form | string | No | |
CustomerId | form | Guid? | No | |
Description | form | string | No |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Id | form | Guid | No |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
CorporateIdentityNumber | form | string | No | |
InvoiceAddress1 | form | string | No | |
InvoiceAddress2 | form | string | No | |
InvoiceCity | form | string | No | |
InvoicePostalCode | form | string | No | |
InvoiceCountryCode | form | string | No |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Id | form | Guid | No | |
Firstname | form | string | No | |
Lastname | form | string | No | |
form | string | No | ||
Phone | form | string | No | |
ImageUrl | form | string | No | |
CustomFields | form | List<CustomFieldConfigData> | No | |
CustomFieldValues | form | List<CustomFieldDataResponse> | No | |
Comments | form | List<CustomerCommentsResponse> | No | |
AccessKeys | form | List<UserAccessKeys> | No | |
Updated | form | DateTime | No | |
Created | form | DateTime | No | |
ResponseStatus | form | Object | No | |
SubscribedToNewsletter | form | bool | No | |
InvoiceAddress | form | InvoiceAddress | No |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Id | form | int | No | Custom field id |
Name | form | string | No | Configuration name. Example: 'Number of persons'. |
Description | form | string | No | Custom field description. Example: 'For how many persons is this booking?' |
Width | form | int? | No | Field width. Example: 20 for 20px |
DataType | form | string | No | Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox' |
DefaultValue | form | string | No | Default value of the field. Example: '3' |
IsMandatory | form | bool | No | Determines if the field is required to have a value or not |
MandatoryErrorMessage | form | string | No | Error message shown to the user if the field data is required but not entered |
MaxLength | form | int | No | Max lenght of the field |
MultipleLineText | form | bool | No | If the field should have multiple lines |
RegEx | form | string | No | Regular expression used for validation of the field |
RegExErrorMessage | form | string | No | Error message shown if the regular expression validation failed |
Values | form | List<CustomFieldValueResponse> | No | The values to select from if Datatype is DropDown for this custom field |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Value | form | string | No |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Id | form | int | No | |
Column | form | string | No | |
Name | form | string | No | |
Description | form | string | No | |
Value | form | string | No | |
DataType | form | string | No | Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox' |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Id | form | int | No | |
CustomerId | form | Guid | No | |
Comments | form | string | No | |
Updated | form | DateTime | No | |
Created | form | DateTime | No | |
ImageUrl | form | Uri | No |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
CompanyId | form | Guid | Yes | |
AccessKeyTypeId | form | int | Yes | |
Value | form | string | Yes | |
CustomerId | form | Guid | Yes | |
Description | form | string | No | |
Id | form | Guid | Yes |
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /customers/{Id} HTTP/1.1
Host: testapi.bokamera.se
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
CompanyId: 00000000-0000-0000-0000-000000000000,
Firstname: String,
Lastname: String,
Phone: String,
Email: String,
CustomFields:
[
{
Id: 0,
Value: String
}
],
AccessKeys:
[
{
Id: 00000000-0000-0000-0000-000000000000,
CompanyId: 00000000-0000-0000-0000-000000000000,
AccessKeyTypeId: 0,
Value: String,
CustomerId: 00000000-0000-0000-0000-000000000000,
Description: String
}
],
AccessKeysToDelete:
[
{
}
],
SubscribedToNewsletter: False,
InvoiceAddress:
{
CorporateIdentityNumber: String,
InvoiceAddress1: String,
InvoiceAddress2: String,
InvoiceCity: String,
InvoicePostalCode: String,
InvoiceCountryCode: String
}
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Firstname: String, Lastname: String, Email: String, Phone: String, ImageUrl: String, CustomFields: [ { "Id": 0, "Name": "String", "Description": "String", "Width": 0, "DataType": "String", "DefaultValue": "String", "IsMandatory": false, "MandatoryErrorMessage": "String", "MaxLength": 0, "MultipleLineText": false, "RegEx": "String", "RegExErrorMessage": "String", "Values": [ { "Value": "String" } ] } ], CustomFieldValues: [ { Id: 0, Column: String, Name: String, Description: String, Value: String, DataType: String } ], Comments: [ { Id: 0, Comments: String } ], AccessKeys: [ { AccessKeyTypeId: 0, Value: String, Description: String } ], ResponseStatus: {}, SubscribedToNewsletter: False, InvoiceAddress: { CorporateIdentityNumber: String, InvoiceAddress1: String, InvoiceAddress2: String, InvoiceCity: String, InvoicePostalCode: String, InvoiceCountryCode: String } }