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=gettimereport&guid=2d497c90-4942-4fc6-9353-4fff6e9d2563&view=1&otherview=NULL&timesheetlineid=NULL&projectid=NULL&filtermyworkitems=True&filtertimecreatoruserid=NULL&filtertimecreatorusergroupid=NULL&filtertimetypeid=NULL&filtertimelevel=0&filtertimestatus=NULL&filterdatefrom=NULL&filterdateto=NULL&filtermodifiedfrom=NULL&filtermodifiedto=NULL&filterprojecttypeid=NULL&filterclientid=NULL&filtertaskid=NULL&filtertaskgroupid=NULL&filtertasktypeid=NULL&countonly=False&isshowtotalsonly=False&fieldstodisplay=NULL&sortorder=NULL&asynccall=False&asynccallid=NULL&exportdomainevaleur=NULL&exporttype=NULL&exportdelimiter=NULL&exportdecimalsymbol=NULL&exportlcid=0&exportonscreencolumnsonly=True&exportview=0&exportviewother=NULL&exportfieldstodisplay=NULL&exportremovehtmlonly=True&exportenablefilterxls=False&format=DS


Function Details
Name Guid Required Description
GetTimeReport True Retrieves list of time sheets for reporting purposes.

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.
View Integer True 1: Daily
2: Weekly
3: Monthly
1 True Grouping by period type
OtherView Integer True 4: Time Status
5: User Group
6: Creator Username
7: Client
8: Project Type
9: Project
10: Task Resume
11: Task Group
12: Task Type
13: Time Type
NULL False Other grouping
TimesheetLineId Integer True NULL False Auto-generated unique time sheet entry (work item) identifier.
ProjectId String True NULL False Auto-generated unique identifier of a project.
FilterMyWorkItems Boolean False True or False True True Returns only the calling user's time sheets (work items) if true.
FilterTimeCreatorUserId String True NULL False Unique identifier of a user to filter on time sheet (work item) creator.
FilterTimeCreatorUserGroupId String True NULL False Unique identifier of a user group to filter user's created time sheets (work items).
FilterTimeTypeId String True NULL False Unique identifier of a time type to filter time sheets on.
FilterTimeLevel Integer False 0: All
1: Project Level Only
2: Task Level Only
0 True Indicates whether to filter on a specific time sheet level.
FilterTimeStatus String True
0: In Progress
3: Submitted
1: Approved
2: Rejected
NULL False Indicates whether to filter on a specific time sheet status.
FilterDateFrom Date True NULL False Filter list from specified date.
FilterDateTo Date True NULL False Filter list to specified date.
FilterModifiedFrom DateTime True NULL True
FilterModifiedTo DateTime True NULL True
FilterProjectTypeId String True NULL False Unique identifier of a project type to filter on.
FilterClientId String True NULL False Unique identifier of a project's associated client to filter on.
FilterTaskId String True NULL False Unique identifier of a task to filter on.
FilterTaskGroupId String True NULL False Unique identifier of a task group to filter on.
FilterTaskTypeId String True NULL False Unique identifier of a task type to filter on.
CountOnly Boolean False True or False False False Indicates whether you want only the number of rows returned by the report
IsShowTotalsOnly Boolean False True or False False False Indicates whether you want only the totals and subtotals
FieldsToDisplay String True NULL False Comma separated fields to display
SortOrder String True NULL False Comma separated fields used for ordering a list.
Asynccall Boolean False True or False False True
Asynccallid Integer True NULL True
ExportDomaineValeur String True NULL True
ExportType String True NULL True
ExportDelimiter String True NULL True
ExportDecimalSymbol String True NULL True
ExportLCID Integer True 0 True
ExportOnScreenColumnsOnly Boolean True True or False True True
ExportView Integer True 0 True
ExportViewOther Integer True NULL True
ExportFieldsToDisplay String True NULL True
ExportRemoveHTMLOnly Boolean True True or False True True
ExportEnableFilterXLS Boolean True True or False False True
Format String False RS: RecordSet
DS: DataSet
JSON: JSON
DS True Return Format

.Net Code:
Public Class Sample

    Public Sub CodeSample_gettimereport()
        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=gettimereport")
            sb.Append(String.Format("&guid={0}", "cbe15f61-d3fb-47ab-8304-4b385cf8abfd"))
            sb.Append(String.Format("&view={0}", 1))
            sb.Append(String.Format("&otherview={0}", "NULL"))
            sb.Append(String.Format("&timesheetlineid={0}", "NULL"))
            sb.Append(String.Format("&projectid={0}", "NULL"))
            sb.Append(String.Format("&filtermyworkitems={0}", True))
            sb.Append(String.Format("&filtertimecreatoruserid={0}", "NULL"))
            sb.Append(String.Format("&filtertimecreatorusergroupid={0}", "NULL"))
            sb.Append(String.Format("&filtertimetypeid={0}", "NULL"))
            sb.Append(String.Format("&filtertimelevel={0}", 0))
            sb.Append(String.Format("&filtertimestatus={0}", "NULL"))
            sb.Append(String.Format("&filterdatefrom={0}", "NULL"))
            sb.Append(String.Format("&filterdateto={0}", "NULL"))
            sb.Append(String.Format("&filtermodifiedfrom={0}", "NULL"))
            sb.Append(String.Format("&filtermodifiedto={0}", "NULL"))
            sb.Append(String.Format("&filterprojecttypeid={0}", "NULL"))
            sb.Append(String.Format("&filterclientid={0}", "NULL"))
            sb.Append(String.Format("&filtertaskid={0}", "NULL"))
            sb.Append(String.Format("&filtertaskgroupid={0}", "NULL"))
            sb.Append(String.Format("&filtertasktypeid={0}", "NULL"))
            sb.Append(String.Format("&countonly={0}", False))
            sb.Append(String.Format("&isshowtotalsonly={0}", False))
            sb.Append(String.Format("&fieldstodisplay={0}", "NULL"))
            sb.Append(String.Format("&sortorder={0}", "NULL"))
            sb.Append(String.Format("&asynccall={0}", False))
            sb.Append(String.Format("&asynccallid={0}", "NULL"))
            sb.Append(String.Format("&exportdomainevaleur={0}", "NULL"))
            sb.Append(String.Format("&exporttype={0}", "NULL"))
            sb.Append(String.Format("&exportdelimiter={0}", "NULL"))
            sb.Append(String.Format("&exportdecimalsymbol={0}", "NULL"))
            sb.Append(String.Format("&exportlcid={0}", 0))
            sb.Append(String.Format("&exportonscreencolumnsonly={0}", True))
            sb.Append(String.Format("&exportview={0}", 0))
            sb.Append(String.Format("&exportviewother={0}", "NULL"))
            sb.Append(String.Format("&exportfieldstodisplay={0}", "NULL"))
            sb.Append(String.Format("&exportremovehtmlonly={0}", True))
            sb.Append(String.Format("&exportenablefilterxls={0}", False))
            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