API Call Samples

We reserve the right to log and verify your API calls and to contact you if we detect abuse on your part. For example:
  • the requests takes too long to return
  • the requests return too much data at a time
  • The requests are too frequent
We strongly suggest using the date filter parameters to return only the data that is relevant.

Select category  

Select function  

Function Details
Name Guid Required Description
SaveClient True Creates a client if no ClientId is specified or updates an existing client when a valid ClientId is specified. You must be an account administrator to access this function.

Code Sample (Visual Basic, Dotnet Framework 4.x):
Public Class Sample
	
	Public Sub CodeSample_saveclient()
		Dim params = New NameValueCollection From {
					{"fct", "saveclient"},
					{"guid", "###"},
					{"clientid", "NULL"},
					{"clientname", "NULL"}
		}

		Dim jsonText = apiCall(params)

		' https://www.newtonsoft.com/json suggested for JSON parsing to DotNet framework 4.x
		Dim jsonObj = Newtonsoft.Json.Linq.JObject.Parse(jsonText)

		Dim success = jsonObj.Item("status").ToString <> "fail"
		Dim jResults = DirectCast(jsonObj.Item("results"), Newtonsoft.Json.Linq.JArray)

		
	End Sub
	    
	Function apiCall(_param As NameValueCollection) As String

		Dim wc As New System.Net.WebClient With {
			.Encoding = System.Text.Encoding.UTF8
		}

		' may be needed on some machines
		Net.ServicePointManager.SecurityProtocol = CType(Net.SecurityProtocolType.Tls12, Net.SecurityProtocolType)

		_param.Item("format") = "iso8601" ' json, with dates formatted as ISO8601 string

		Dim responseBytes = wc.UploadValues("https://api.aceproject.com", "POST", _param)
		Return System.Text.Encoding.UTF8.GetString(responseBytes)

	End Function

End Class

Parameter Details
Name DataType Is Nullable Max length Domain Values Default Value Is Required
(Insert)
Is Required
(Update)
Is Required Description
Guid String False True Unique identifier for the authenticated user. The GUID has an expiry date and time which is managed automatically by the API.
Clientid Integer True NULL False True Auto-generated unique identifier of a client.
ClientName String True 100 NULL True False Unique client name.
ClientNumber String True 50 NULL False User-defined client number.
ClientAddress String True NULL False Client's address.
ClientCity String True 100 NULL False Client's city.
ClientProvince String True 50 NULL False Client's province.
ClientCountry String True 100 NULL False Client's country.
ClientZipcode String True 20 NULL False Client's zip code or postal code.
ClientPhoneNumber String True 30 NULL False Client's phone number.
ClientFaxNumber String True 30 NULL False Client's fax number.
ClientEmail String True 100 NULL False Client's e-mail address.
ClientURL String True 255 NULL False Client's Web site URL.
ClientNote String True NULL False Notes related to the client.
ClientContactName String True 100 NULL False Client's contact name.
ClientContactPhoneNumber String True 30 NULL False Contact's phone number.
ClientContactFaxNumber String True 30 NULL False Contact's fax number.
ClientContactEmail String True 100 NULL False Contact's e-mail address.
ClientContactMobile String True 30 NULL False Contact's mobile number.
Format String False RS: RecordSet
DS: DataSet
JSON: JSON
DS True Return Format