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=saveuser&guid=dbfab3f7-0748-4e34-9aab-610d98154593&userid=NULL&usertypeid=NULL&username=sampleuser&currentpassword=NULL&password=samplepassword&passwordconfirm=NULL&usergroupid=NULL&email=NULL&firstname=NULL&lastname=NULL&phonenumber=NULL&cellnumber=NULL&faxnumber=NULL&canaddproject=NULL&viewfinancialdata=NULL&accessstatusid=NULL&caneditemailnotifs=NULL&timeentrymode=NULL&timeapproverbydefault=NULL&expenseentrymode=NULL&canapproveownexpense=NULL&userdirectoryaccess=NULL&helpview=NULL&emaillanguage=NULL&sendemailonadd=NULL&sendemailonupdatecreator=NULL&sendemailonupdateassignee=NULL&sendemailsuccessorstart=NULL&tasksperpage=NULL&projectsperpage=NULL&expensesperpage=NULL&defaultpage=NULL&defaultpagemyoffice=NULL&tasksortfield=NULL&tasksortorder=NULL&projectsortfield=NULL&projectsortorder=NULL&timezone=NULL&dateformat=NULL&usetypicalworkday=NULL&typicalhoursworkday=NULL&sendemailincludingmyself=NULL&sendemailonassignproject=NULL&sendemailtaskreminder=NULL&typeemailtaskreminder=NULL&avatarguid=NULL&facebookid=NULL&viewcustomreport=NULL&favoritecustomreportid=NULL&costtracking=NULL&timetracking=NULL&canmanageclient=NULL&notify=False&format=DS


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

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.
UserId Integer True NULL False True Auto-generated unique identifier of a user.
UserTypeId Integer True 1: Normal
2: Administrator
NULL True False User type identifier, also known as access level.
Username String True 50 NULL True False Unique username given to a user. The username is used to log in and must be unique throughout the account.
CurrentPassword String True 50 NULL True
Password String True 50 NULL True False Password related to the username used upon log in.
PasswordConfirm String True 50 NULL True False Password related to the username used upon log in. This parameter is required when Password is specified.
UserGroupId Integer True NULL False Auto-generated unique identifier of a user group.
Email String True 100 Valid email address NULL False User's e-mail used for notifications.
FirstName String True 50 NULL False User's first name.
LastName String True 50 NULL False User's last name or surname.
PhoneNumber String True 30 NULL False User's phone number.
CellNumber String True 30 NULL False User's cellular phone number.
FaxNumber String True 30 NULL False User's fax number.
CanAddProject Boolean True True or False NULL True False Indicates whether a user can add projects in the account. Administrators can always add projects.
ViewFinancialData Boolean True True or False NULL True False Indicates whether the user can see all financial data within the account, even without approval accesses on the projects. Administrators can always see financial data.
AccessStatusId Integer True 1: Active - Access Allowed
2: Active - Acces Denied
3: Inactve - Access Denied
NULL True False User's access status.
CanEditEmailNotifs Boolean True True or False NULL True False Indicates whether the user can edit his or her e-mail notification settings through his or her preferences. Administrators can always edit thier settings.
TimeEntryMode Integer True 1: Timesheet + Time Clock
2: Timesheet
3: Time Clock
4: Disabled
NULL True False Indicates how a user can enter time. If disabled, the user will not have access to timesheets. Administrators can always enter time either through time sheet work items or using the time clock.
TimeApproverByDefault Integer True NULL False
ExpenseEntryMode Integer True 1: Can add expenses
2: Disabled
NULL True False Indicates how a user can enter expenses. If disabled, the user will not have access to expenses. Administrators can always enter expenses. This setting is ignored when cost tracking is disabled on the account.
CanApproveOwnExpense Boolean True True or False NULL True False Indicates whether the user can approve his or her own expenses entered into the system even with expense approval on a project. Administrators can always approve thier own expenses. This setting is ignored when cost tracking is disabled on the account.
UserDirectoryAccess Integer True 1: Display all users3: Users assigned on the same projects
4: Users in the same group
5: Disabled
NULL True False Indicates what a user can see in the user directory. Administrators can always see all users.
HelpView Integer True 1: Show Help Link + Show Contextual Help Link
2: Show Help Link only
3: Show Contextual Help Link only
4: Hide Help Link + Hide Contextual Help Link
NULL True False Shows how a user can access the Help section.
EmailLanguage Integer True 0: English
1: French
NULL True False Language to use for e-mail notifications to the user.
SendEmailOnAdd Boolean True True or False NULL True False Email notification when a task is created if user is assigned or reviewer.
SendEmailOnUpdateCreator Boolean True True or False NULL True False Email notification when a task is updated if user is creator.
SendEmailOnUpdateAssignee Boolean True True or False NULL True False Email notification when a task is updated if user is assigned or reviewer.
SendEmailSuccessorStart Boolean True True or False NULL True False Email notification when a successor task can start if user is assigned or reviewer.
TasksPerPage Integer True 10, 15, 20, 25, 50, 75, 100 NULL True False User's preference of number of tasks per page.
ProjectsPerPage Integer True 10, 15, 20, 25, 50, 75, 100 NULL True False User's preference of number of projects per page.
ExpensesPerPage Integer True 10, 15, 20, 25, 50, 75, 100 NULL True False User's preference of number of expenses per page.
DefaultPage String True LastOpenedProject: Last Viewed Project
MyOffice: My Office
NULL False User's preference for default tab to load upon login.
DefaultPageMyOffice String True Dashboard: Dashboard
MyTask: My Tasks
MyMarkedTask: My Marked Tasks
MyMarkedProject: My Marked Projects
MyTimesheet: My Timesheets
MyExpense: My Expenses
NULL False User's preference for default page to load upon loading the My Office tab.
TaskSortField Integer True 1: Number
2: Summary
3: Status
4: Priority
5: Start Date
6: End Date
7: Last Update
NULL True False User's preference for default task sorting in task reports and lists which do not use Show/Hide settings. Used in conjunction with TaskSortOrder parameter.
TaskSortOrder Integer True 1: Ascending
2: Descending
NULL True False User's preference for default task ordering in task reports and lists which do not user Show/Hide settings. Used in conjunction with TaskSortField parameter.
ProjectSortField Integer True 1: Number
2: Name
3: Priority
4: Start Date
5: End Date
6: % Done
NULL True False User's preference for default project sorting in project reports and lists which do not use Show/Hide settings. Used in conjunction with ProjectSortOrder parameter.
ProjectSortOrder Integer True 1: Ascending
2: Descending
NULL True False User's preference for default project ordering in project reports and lists which do no use Show/Hide settings. Used in conjunction with ProjectSortField parameter.
Timezone String True NULL: Use account timezone
or
See GetTimeZonesList function for valid timezones
NULL False User's timezone (timezone identifier from the list of available timezones for AceProject).
DateFormat Integer True NULL: Use account date format
1033 : m/d/yyyy 12:00:00 AM (0.0)
1041 : yyyy/mm/dd 24:00:00 (0.0)
2057 : dd/mm/yyyy 24:00:00 (0.0)
3084 : yyyy-mm-dd 24:00:00 (0,0)
4105 : yyyy-mm-dd 12:00:00 AM (0.0)
7177 : yyyy/mm/dd 24:00:00 (0,0)
NULL False Default account date and number format.
UseTypicalWorkday Boolean True True or False NULL True False Indicates whether the user has a typical number of work hours per day.
TypicalHoursWorkDay Decimal True NULL: Use account default value
0 to 24
NULL False Number of hours worked by the user in a typical day. Parameter is ignored if UseTypicalWorkDay is false.
SendEmailIncludingMyself Boolean True True or False NULL True
SendEmailOnAssignProject Boolean True True or False NULL True
SendEmailTaskReminder Integer True NULL True
TypeEmailTaskReminder Integer True NULL True
AvatarGUID String True NULL True
FacebookID String True NULL True
ViewCustomReport Boolean True True or False NULL True
FavoriteCustomReportId Integer True NULL True
CostTracking Boolean True True or False NULL True
TimeTracking Boolean True True or False NULL True
CanManageClient Boolean True True or False NULL False Indicates whether the user can manage clients.
Notify Boolean False True or False False False Indicates whether to send an email notification to the user with his or her connection information.
Format String False RS: RecordSet
DS: DataSet
JSON: JSON
DS True Return Format

.Net Code:
Public Class Sample

    Public Sub CodeSample_saveuser()
        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=saveuser")
            sb.Append(String.Format("&guid={0}", "61d204ae-d760-42b2-bc32-33a04d6b2a86"))
            sb.Append(String.Format("&userid={0}", "NULL"))
            sb.Append(String.Format("&usertypeid={0}", "NULL"))
            sb.Append(String.Format("&username={0}", "sampleuser"))
            sb.Append(String.Format("&currentpassword={0}", "NULL"))
            sb.Append(String.Format("&password={0}", "samplepassword"))
            sb.Append(String.Format("&passwordconfirm={0}", "NULL"))
            sb.Append(String.Format("&usergroupid={0}", "NULL"))
            sb.Append(String.Format("&email={0}", "NULL"))
            sb.Append(String.Format("&firstname={0}", "NULL"))
            sb.Append(String.Format("&lastname={0}", "NULL"))
            sb.Append(String.Format("&phonenumber={0}", "NULL"))
            sb.Append(String.Format("&cellnumber={0}", "NULL"))
            sb.Append(String.Format("&faxnumber={0}", "NULL"))
            sb.Append(String.Format("&canaddproject={0}", "NULL"))
            sb.Append(String.Format("&viewfinancialdata={0}", "NULL"))
            sb.Append(String.Format("&accessstatusid={0}", "NULL"))
            sb.Append(String.Format("&caneditemailnotifs={0}", "NULL"))
            sb.Append(String.Format("&timeentrymode={0}", "NULL"))
            sb.Append(String.Format("&timeapproverbydefault={0}", "NULL"))
            sb.Append(String.Format("&expenseentrymode={0}", "NULL"))
            sb.Append(String.Format("&canapproveownexpense={0}", "NULL"))
            sb.Append(String.Format("&userdirectoryaccess={0}", "NULL"))
            sb.Append(String.Format("&helpview={0}", "NULL"))
            sb.Append(String.Format("&emaillanguage={0}", "NULL"))
            sb.Append(String.Format("&sendemailonadd={0}", "NULL"))
            sb.Append(String.Format("&sendemailonupdatecreator={0}", "NULL"))
            sb.Append(String.Format("&sendemailonupdateassignee={0}", "NULL"))
            sb.Append(String.Format("&sendemailsuccessorstart={0}", "NULL"))
            sb.Append(String.Format("&tasksperpage={0}", "NULL"))
            sb.Append(String.Format("&projectsperpage={0}", "NULL"))
            sb.Append(String.Format("&expensesperpage={0}", "NULL"))
            sb.Append(String.Format("&defaultpage={0}", "NULL"))
            sb.Append(String.Format("&defaultpagemyoffice={0}", "NULL"))
            sb.Append(String.Format("&tasksortfield={0}", "NULL"))
            sb.Append(String.Format("&tasksortorder={0}", "NULL"))
            sb.Append(String.Format("&projectsortfield={0}", "NULL"))
            sb.Append(String.Format("&projectsortorder={0}", "NULL"))
            sb.Append(String.Format("&timezone={0}", "NULL"))
            sb.Append(String.Format("&dateformat={0}", "NULL"))
            sb.Append(String.Format("&usetypicalworkday={0}", "NULL"))
            sb.Append(String.Format("&typicalhoursworkday={0}", "NULL"))
            sb.Append(String.Format("&sendemailincludingmyself={0}", "NULL"))
            sb.Append(String.Format("&sendemailonassignproject={0}", "NULL"))
            sb.Append(String.Format("&sendemailtaskreminder={0}", "NULL"))
            sb.Append(String.Format("&typeemailtaskreminder={0}", "NULL"))
            sb.Append(String.Format("&avatarguid={0}", "NULL"))
            sb.Append(String.Format("&facebookid={0}", "NULL"))
            sb.Append(String.Format("&viewcustomreport={0}", "NULL"))
            sb.Append(String.Format("&favoritecustomreportid={0}", "NULL"))
            sb.Append(String.Format("&costtracking={0}", "NULL"))
            sb.Append(String.Format("&timetracking={0}", "NULL"))
            sb.Append(String.Format("&canmanageclient={0}", "NULL"))
            sb.Append(String.Format("&notify={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