Form Field Types
Id Name
1 Text
2 Number
3 Date
4 Time
5 List
6 MultiList
7 Attachment
8 Signature
Additionally, these values can be obtained from /Settings response.
| Create Service Form | |
| URL | /ServiceForm |
| Method | POST |
| Body |
{ "FormFields":[] |
| Response |
{
"Data": null, "Id": 2, "IsSuccess": true, "Message": "Added" } |
| Comments |
This request allows user to create a new Service Form. The response has standard format, it contains Id and IsSuccess fields. Id should be persisted somewhere for future usage. |
| Get Service Forms | |
| URL | /ServiceForms |
| Method | GET |
| Body |
|
| Response |
[ |
| Comments |
This request allows user to get all Service Forms and their fields. If field's type is List or Multi-List then ListItems property in response is not empty - it is an array of strings (like field "MultiList" in the example below). If default value is set for a field then: |
| Create Service Form Fields | |
| URL | /ServiceFormField |
| Method | POST |
| Body |
If field's type is either Text, or Number, or Date, or Time (ServiceFormFieldTypeId property should be changed correspondingly) If field's type is either List or Multi-List (ServiceFormFieldTypeId property should be changed correspondingly) If field's type is either Attachment or Signature (ServiceFormFieldTypeId property should be changed correspondingly) |
| Response |
{ NOTE. If user sends DefaultFile property then the response will contain Data field with random GUID. This GUID should be persisted for future usages (e.g. file upload/download) |
| Comments |
This request allows user to create a new Service Form Field for specific Service Form. The response has standard format, it contains Id and IsSuccess fields. Id should be persisted somewhere for future usage. |
| Attach Service Form to Customer | |
| URL | /ServiceForm/Customer |
| Method | POST |
| Body |
{ "CustomName":"Form1" |
| Response |
{ |
| Comments |
This request allows user to attach a Service Form to specific Customer. The response has standard format, it contains Id and IsSuccess fields. Id should be persisted somewhere for future usage. |
| Get All Customers Service Forms | |
| URL | /ServiceForm/Customer/{customerId} |
| Method | GET |
| Body |
|
| Response |
[ |
| Comments |
This request allows user to get all Service Forms attached to specific Customer. |
| Fill field Customers Service Forms | |
| URL | /CustomerServiceForm/Fill |
| Method | PUT |
| Body |
If field's type is either Text, or Number, or Date, or Time If field's type is either List or Multi-List If field's type is either Attachment or Signature |
| Response |
{ NOTE. If user sends File property then the response will contain Data field with random GUID. This GUID should be persisted for future usages (e.g. file upload/download) |
| Comments |
This request allows user to fill the value for one field of Customer Service Form. |
| Get all field values of Customer Service Form | |
| URL | /CustomerServiceForm/{customerServiceFormId} |
| Method | GET |
| Body |
|
| Response |
Response: [ |
| Comments |
|
| Attach a Service Form to specific Work Order/Task | |
| URL | /ServiceForm/WorkOrder |
| Method | POST |
| Body |
{ |
| Response |
{ |
| Comments |
This request allows user to attach a Service Form to specific Work Order/Task. The response has standard format, it contains Id and IsSuccess fields. Id should be persisted somewhere for future usage. |
| Get all Service Forms attached to specific Work Order / Task | |
| URL | /ServiceForm/WorkOrder/{workOrderId} |
| Method | GET |
| Body |
|
| Response |
[ |
| Comments |
This request allows user to get all Service Forms attached to specific Work Order / Task |
| Fill the value for one field of Work Order Service Form | |
| URL | /WorkOrderServiceForm/Fill |
| Method | PUT |
| Body |
If field's type is either Text, or Number, or Date, or Time { If field's type is either List or Multi-List If field's type is either Attachment or Signature |
| Response |
{ |
| Comments |
This request allows user to fill the value for one field of Work Order Service Form |
| Get all field values of Work Order Service Form | |
| URL | /WorkOrderServiceForm/{workOrderServiceFormId} |
| Method | GET |
| Body |
|
| Response |
Response format is the same as for GET /CustomerServiceForm/{customerServiceFormId} response |
| Comments |
This request allows user to get all field values of Work Order Service Form |
| Download an attachment | |
| URL | /ServiceFormFieldFile/{fileNameInternal} |
| Method | GET |
| Body |
|
| Response |
|
| Comments |
This request allows user to download an attachment. FileNameInternal is a GUID mentioned above multiple times. |
| Upload an attachment | |
| URL | /ServiceFormFieldFile/{fileNameInternal} |
| Method | POST |
| Body |
|
| Response |
|
| Comments |
This request allows user to upload an attachment. FileNameInternal is a GUID mentioned above multiple times. |
Here is example of C# code for uploading files to the REST service.
|
FileStream stream = File.OpenRead(@"C:\Users\Public\Pictures\Sample Pictures\Desert.jpg");
byte[] arr = new byte[stream.Length];
stream.Read(arr, 0, System.Convert.ToInt32(stream.Length));
stream.Close();
WebClient client = new WebClient();
client.Headers.Add("Content-Type", "image/jpeg");
client.Headers.Add("ServerName", "a1plumbing");
client.Headers.Add("Token", "8c591856-b88a-4f07-bb2c-c0d81e70a593");
var results = client.UploadData("http://a1plumbing.0.razorsync.com/ApiService.svc/ServiceFormFieldFile/9912de85-fbbb-4c2e-9df7-3c11549f5ca8", "POST", arr);
|
|---|