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.

Selecting a category  

Selecting a function  

HTTP GET:

https://api.aceproject.com/?fct=updateproject&guid=d23d168a-67e7-4546-a5ce-ebf1c7741ec1&projectid=###&projectnumber=NULL&projectname=NULL&projecttypeid=NULL&projectdesc=NULL&nexttasknumber=NULL&budgethours=NULL&budgetcost=NULL&estimatedstartdate=NULL&estimatedenddate=NULL&estimatedprojecthours=NULL&estimatedprojectexpenses=NULL&actualstartdate=NULL&actualenddate=NULL&projectpriorityid=NULL&projectstatusid=NULL&projecttemplate=NULL&contactname=NULL&contactphone=NULL&contactemail=NULL&contactcell=NULL&contactfax=NULL&defaultestimatedtime=NULL&defaulttaskstartdate=NULL&defaulttaskenddate=NULL&defaulttaskactualdates=NULL&clientid=NULL&includeweekends=NULL&incompletestaskssetto=NULL&timestatussetto=NULL&expensestatussetto=NULL&mandatorydependency=NULL&format=DS


Function Details
Name Guid Required Description
UpdateProject True Updates an existing project. You must be an administrator or the project's project manager to access this function for a specific project.

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.
ProjectId Integer False True Auto-generated unique identifier of a project.
ProjectNumber String True 50 NULL False Unique alpha-numeric user-defined project number.
ProjectName String True 50 NULL False Unique alpha-numeric user-defined project name.
ProjectTypeId Integer True NULL False Auto-generated unique identifier of a project type.
ProjectDesc String True NULL False Describes any relevant information about the project.
NextTaskNumber Integer True NULL False Next number to use for auto-numbering tasks within the project. This number is then automatically managed upon adding new tasks.
BudgetHours Decimal True NULL False Budgeted hours for the project.
BudgetCost Decimal True NULL False Budgeted cost for the project. This field is ignored if cost tracking is disabled for the account.
EstimatedStartDate Date True NULL False Estimated project start date. Date must be smaller than the EstimatedEndDate.
EstimatedEndDate Date True NULL False Estimated project end date. Date must be greater than the EstimatedStartDate.
EstimatedProjectHours Decimal True Greator or equal to 0 NULL False Estimated project hours (does not include estimated task hours).
EstimatedProjectExpenses Decimal True Greator or equal to 0 NULL False Estimated project expenses (does not include estimated task expenses). This parameter is ignored if cost tracking is disabled for the account.
ActualStartDate Date True NULL False Actual project start date. This date is user-defined and not automated by the system. Date must be smaller than the ActualEndDate.
ActualEndDate Date True NULL False Actual project end date. This date is user-defined and not automated by the system. Date must be greater than ActualStartDate.
ProjectPriorityId Integer True NULL False Auto-generated unique identifier of a project priority.
ProjectStatusId Integer True NULL False Auto-generated unique identifier of a project status.
ProjectTemplate Integer True 0: Not a template
1: Dynamic template
2: Static template
NULL False Indicates if the project is a template and if it is static or dynamic.
ContactName String True NULL False Contact's name
ContactPhone String True NULL False Contact's phone number
ContactEmail String True NULL False Contact's E-mail
ContactCell String True NULL False Contact's mobile number
ContactFax String True NULL False Contact's fax number
DefaultEstimatedTime Decimal True Greator or equal to 0 NULL False Task's estimated hours to use as a default for new tasks.
DefaultTaskStartDate Integer True 1: No date
2: Today's date
3: Next day
4: Next business day
5: Project's Estimated Start Date
NULL False Task's estimated start date to use as a default for new tasks.
DefaultTaskEndDate Integer True 1: No date
2: Task's Estimated Start Date
3: Project's Estimated End Date
NULL False Task's estimated end date to use as a default for new tasks.
DefaultTaskActualDates Integer True 1: Manual
2: Automatic
NULL False Indicates whether task actual start and end dates are to be populated automatically (triggered by changes on the status) or manually.
ClientId Integer True NULL False Auto-generated unique identifier of a client.
IncludeWeekends Boolean True True or False NULL False Indicates whether to include weekends in the working days (Monday to Friday when excluding weekends) calculation, when task dates are adjusted
IncompletesTasksSetTo Integer True NULL True
TimeStatusSetTo Integer True NULL True
ExpenseStatusSetTo Integer True NULL True
MandatoryDependency Boolean True True or False NULL False Indicates whether project dependencies will be mandatory by default or not.
Format String False RS: RecordSet
DS: DataSet
JSON: JSON
DS True Return Format

.Net Code:
Public Class Sample

    Public Sub CodeSample_updateproject()
        Dim strXML As String = String.Empty

        Dim dsOutput As DataSet = Nothing
        Dim guid As String = String.Empty
        Dim sb As New System.Text.StringBuilder
        Try
            sb = New System.Text.StringBuilder
            'Building API QueryString
            sb.Append("fct=updateproject")
            sb.Append(String.Format("&guid={0}", "fa55b219-06db-4160-b954-d24da685c3cc"))
            sb.Append(String.Format("&projectid={0}", ###))
            sb.Append(String.Format("&projectnumber={0}", "NULL"))
            sb.Append(String.Format("&projectname={0}", "NULL"))
            sb.Append(String.Format("&projecttypeid={0}", "NULL"))
            sb.Append(String.Format("&projectdesc={0}", "NULL"))
            sb.Append(String.Format("&nexttasknumber={0}", "NULL"))
            sb.Append(String.Format("&budgethours={0}", "NULL"))
            sb.Append(String.Format("&budgetcost={0}", "NULL"))
            sb.Append(String.Format("&estimatedstartdate={0}", "NULL"))
            sb.Append(String.Format("&estimatedenddate={0}", "NULL"))
            sb.Append(String.Format("&estimatedprojecthours={0}", "NULL"))
            sb.Append(String.Format("&estimatedprojectexpenses={0}", "NULL"))
            sb.Append(String.Format("&actualstartdate={0}", "NULL"))
            sb.Append(String.Format("&actualenddate={0}", "NULL"))
            sb.Append(String.Format("&projectpriorityid={0}", "NULL"))
            sb.Append(String.Format("&projectstatusid={0}", "NULL"))
            sb.Append(String.Format("&projecttemplate={0}", "NULL"))
            sb.Append(String.Format("&contactname={0}", "NULL"))
            sb.Append(String.Format("&contactphone={0}", "NULL"))
            sb.Append(String.Format("&contactemail={0}", "NULL"))
            sb.Append(String.Format("&contactcell={0}", "NULL"))
            sb.Append(String.Format("&contactfax={0}", "NULL"))
            sb.Append(String.Format("&defaultestimatedtime={0}", "NULL"))
            sb.Append(String.Format("&defaulttaskstartdate={0}", "NULL"))
            sb.Append(String.Format("&defaulttaskenddate={0}", "NULL"))
            sb.Append(String.Format("&defaulttaskactualdates={0}", "NULL"))
            sb.Append(String.Format("&clientid={0}", "NULL"))
            sb.Append(String.Format("&includeweekends={0}", "NULL"))
            sb.Append(String.Format("&incompletestaskssetto={0}", "NULL"))
            sb.Append(String.Format("&timestatussetto={0}", "NULL"))
            sb.Append(String.Format("&expensestatussetto={0}", "NULL"))
            sb.Append(String.Format("&mandatorydependency={0}", "NULL"))
            sb.Append(String.Format("&format={0}", "DS"))

            'Calling API
            strXML = CallHttp("https://api.aceproject.com/", sb.ToString)
            'Retreive Output structure generate by API
            dsOutput = Deserialize(Of DataSet)(strXML)
            If dsOutput IsNot Nothing AndAlso dsOutput.Tables.Count > 0 Then
                If dsOutput.Tables.Contains("dtAPIErrors") Then
                    Throw New Exception(String.Format("{0}: {1}", _
                                                      dsOutput.Tables(0).Rows(0).Item("ErrorNumber").ToString, _
                                                      dsOutput.Tables(0).Rows(0).Item("ErrorDescription").ToString))
                End If
            End If
        Catch ex As Exception
            Throw
        Finally
            If sb IsNot Nothing Then sb = Nothing
            If dsOutput IsNot Nothing Then
                dsOutput.Dispose()
                dsOutput = Nothing
            End If
        End Try
    End Sub

    Private Shared Function CallHttp( ByVal url As String, _ 
                                      ByVal params As String) As String
        Dim loHttp As System.Net.HttpWebRequest
        loHttp = CType(System.Net.WebRequest.Create(url), System.Net.HttpWebRequest)
        loHttp.Method = "POST"
        Dim requestWriter As System.IO.StreamWriter = New System.IO.StreamWriter(loHttp.GetRequestStream())

        If Not String.IsNullOrEmpty(params) Then
            requestWriter.Write(params)
        End If
        requestWriter.Close()
        loHttp.ContentType = "application/x-www-form-urlencoded"
        loHttp.Headers.Set("Pragma", "no-cache")
        loHttp.AllowAutoRedirect = True
        loHttp.KeepAlive = True
        loHttp.Timeout = 30 * 1000

        Dim loWebResponse As System.Net.HttpWebResponse = CType(loHttp.GetResponse(), System.Net.HttpWebResponse)
        Dim enc As Encoding = System.Text.Encoding.UTF8
        Dim loResponseStream As System.IO.StreamReader = New System.IO.StreamReader(loWebResponse.GetResponseStream(), enc)
        Dim lcHtml As String = loResponseStream.ReadToEnd()

        loWebResponse.Close()
        loResponseStream.Close()

        Return lcHtml
    End Function


    Private Shared Function Deserialize(Of T)( ByVal strXML As String) As T
        Dim objet As T = Nothing
        Dim objType As Type = GetType(T)
        Try
            If Not String.IsNullOrEmpty(strXML) Then
                Dim objSerializer As New System.Xml.Serialization.XmlSerializer(objType)
                Dim objText As New System.Text.StringBuilder()
                Dim objXmlReader As New System.IO.StringReader(strXML)
                objet = DirectCast(objSerializer.Deserialize(objXmlReader), T)
                objXmlReader.Close()
            End If
            Return objet
        Catch ex As Exception
            Throw
        Finally
            If objet IsNot Nothing Then objet = Nothing
        End Try
    End Function

End Class