Ajera API
message for Ajera API general doc
For additional api methods see the following below:
Home
Clients API
Contacts API
Employees API
Vendors API
Expense Reports API
GL Accounts API
Various List Methods
Messages ¶
Group of all messages-related resources.
API Endpoint ¶
id
is an Ajera API specific id that is required to access the API for any given
API server call. This id and specific url can be obtained from the
Ajera 8 Menu Utility -> Setup Integrations -> API Settings
List ProjectsPOST/AjeraAPI.ashx?{id}
This method is identical to version 1.0 of the API. See the ListProjects in v1 for more information.
Example URI
- id
string
(required) Example: ew0KICAiRGF0YWJhc2VOYW1lIjogIkFqZXJhX01haW4iDQp9An unique identifier required for api access.
Get ProjectsPOST/AjeraAPI.ashx?{id}
Version 2 of the API has been updated to change the way the data is structured. Instead of returning a project in a hierarchy, it is now returned as a flat list of objects. This allows for more flexibility.
The 4 types of objects:
-
Projects
-
InvoiceGroups
-
Phases
-
Resources
This method returns detailed information, which can be used to populate required fields when calling UpdateProjects.
For a developer to use this method and to understand the hierarchy, each object type contain additional properties that will link to other objects with the exception of Projects.
Additional Properties by Object Type:
-
InvoiceGroups
- ProjectKey - The ProjectKey of the Project that the InvoiceGroup belongs to.
-
Phases
- ProjectKey - The ProjectKey of the Project that the Phase belongs to.
- InvoiceGroupKey - The InvoiceGroupKey of the InvoiceGroup that the Phase belongs to.
- ParentKey - The PhaseKey of the parent Phase and will equal the ProjectKey if the Phase is a top level Phase.
-
Resources
- PhaseKey - The PhaseKey of the Phase that the Resource belongs to.
CustomFields are also handled differently in this version of the API. In version 1 of the API, CustomFields where prepended with CF and the name of the field. In version 2 of the API, CustomFields are located within a CustomFields object as key/value pairs.
If a Project/Phase does not have any CustomFields, the CustomFields object will not be returned.
Example URI
- id
string
(required) Example: ew0KICAiRGF0YWJhc2VOYW1lIjogIkFqZXJhX01haW4iDQp9An unique identifier required for api access.
GetProjects
Headers
Content-Type: application/json
Body
{
Method: "GetProjects",
SessionToken: "",
MethodArguments: {
RequestedProjects: [1, 2, 3]
}
}
200
Headers
Content-Type: application/json
Body
{
Content: {
Projects: [
{
ProjectKey: 1,
Description: "",
ID: "",
Status: "Active",
CompanyKey: 1,
CompanyDescription: "",
ProjectTypeKey: 1,
ProjectTypeDescription: "",
DepartmentKey: 1,
DepartmentDescription: "",
BudgetedOverheadRate: 175.0,
ProjectManager: {
EmployeeKey: 1,
FirstName: "PM",
MiddleName: "",
LastName: ""
},
PrincipalInCharge: {
EmployeeKey: 2,
FirstName: "PC",
MiddleName: "",
LastName: ""
},
MarketingContact: {
EmployeeKey: 3,
FirstName: "MC",
MiddleName: "",
LastName: ""
},
Location: "",
WageTableKey: 1,
WageTableDescription: "",
IsCertified: false,
RestrictTimeEntryToResourcesOnly: false,
TaxState: "OR",
TaxLocalKey: 1,
TaxLocalDescription: "",
EstimatedStartDate: "2015-03-11",
EstimatedCompletionDate: "2015-03-11",
ActualStartDate: "2015-03-11",
ActualCompletionDate: "2015-03-11",
ApplySalesTax: false,
SalesTaxCode: "",
SalesTaxRate: 0.000,
RequireTimesheetNotes: false,
Notes: "project notes",
HoursCostBudget: 0.00,
LaborCostBudget: 0.00,
ExpenseCostBudget: 0.00,
ConsultantCostBudget: 0.00,
PercentDistribution: 0.00,
IsFinalBudget: false,
BillingType: "TimeAndExpense",
RateTableKey: 1,
RateTableDescription: "",
TotalContractAmount: 0.00,
LaborContractAmount: 0.00,
ExpenseContractAmount: 0.00,
ConsultantContractAmount: 0.00,
LockFee: false,
BillLaborAsTE: false,
BillExpenseAsTE: false,
BillConsultantAsTE: false,
Units: 0.00,
UnitRate: 0.0000,
UnitDescription: "",
ConstructionCost: 0.00,
PercentOfConstructionCost: 0.0000,
ReportedPercentComplete: 0.0000,
ReportedPercentDate: "2015-03-11",
BillingDescription: "",
PhaseInvoiceText: "",
LaborInvoiceText: "",
ExpenseInvoiceText: "",
ConsultantInvoiceText: "",
LaborEntry: false,
ExpenseConsultantEntry: false,
Contacts: [
{
ContactKey: 1,
Order: 1,
Text: "",
Description: "",
FirstName: "C1",
MiddleName: "",
LastName: "",
Title: "",
}
]
}
],
InvoiceGroups: [
{
InvoiceGroupKey: 1,
Description: "",
Client: {
ClientKey: 1,
Description: "",
},
InvoiceFormatKey: 1,
InvoiceFormatDescription: "",
EmailInvoiceTemplateKey: 1,
EmailInvoiceTemplateDescription: "Default Template",
EmailClientStatementTemplateKey: 1,
EmailClientStatementTemplateDescription: "Default Template",
PrintBackup: false,
EmailIncludeBackup: false,
BillingManager: {
EmployeeKey: 1,
FirstName: "",
MiddleName: "",
LastName: ""
},
BillingContact: {
ContactKey: 2,
Description: "",
FirstName: "",
MiddleName: "",
LastName: ""
},
InvoiceHeaderText: "",
InvoiceFooterText: "",
InvoiceScope: "",
Notes: "invoice gropup notes"
}
],
Phases: [
{
PhaseKey: 1,
Description: "",
ID: "",
Notes: "phase notes",
IsBillingGroup: false,
SummarizeBillingGroup: false,
Status: "Active",
CompanyKey: 1,
CompanyDescription: "",
ProjectTypeKey: 1,
ProjectTypeDescription: "",
DepartmentKey: 1,
DepartmentDescription: "",
ProjectManager: {
EmployeeKey: 1,
FirstName: "",
MiddleName: "",
LastName: ""
},
PrincipalInCharge: {
EmployeeKey: 1,
FirstName: "",
MiddleName: "",
LastName: ""
},
MarketingContact: {
EmployeeKey: 1,
FirstName: "",
MiddleName: "",
LastName: ""
},
Location: "",
WageTableKey: 1,
WageTableDescription: "",
IsCertified: false,
RestrictTimeEntryToResourcesOnly: false,
TaxState: "OR",
TaxLocalKey: 1,
TaxLocalDescription: "",
EstimatedStartDate: "2015-03-11",
EstimatedCompletionDate: "2015-03-11",
ActualStartDate: "2015-03-11",
ActualCompletionDate: "2015-03-11",
ApplySalesTax: false,
SalesTaxCode: "",
SalesTaxRate: 0.000,
RequireTimesheetNotes: false,
HoursCostBudget: 0.00,
LaborCostBudget: 0.00,
ExpenseCostBudget: 0.00,
ConsultantCostBudget: 0.00,
PercentDistribution: 0.00,
IsFinalBudget: false,
BillingType: "TimeAndExpense",
RateTableKey: 1,
RateTableDescription: "",
TotalContractAmount: 0.00,
LaborContractAmount: 0.00,
ExpenseContractAmount: 0.00,
ConsultantContractAmount: 0.00,
LockFee: false,
BillLaborAsTE: false,
BillExpenseAsTE: false,
BillConsultantAsTE: false,
Units: 0.00,
UnitRate: 0.0000,
UnitDescription: "",
ReportedPercentComplete: 0.0000,
ReportedPercentCompleteDate: "2015-03-11",
BillingDescription: "",
PhaseInvoiceText: "",
LaborInvoiceText: "",
ExpenseInvoiceText: "",
ConsultantInvoiceText: "",
Contacts: [
{
ContactKey: 3,
Order: 1,
Text: "",
Description: "",
FirstName: "",
MiddleName: "",
LastName: "",
Title: "",
}
]
}
],
Resources: [
{
ResourceKey: 42,
PhaseKey: 33,
Status: "NotStarted",
Priority: "Null",
Description: "",
Notes: "",
IsTask: false,
ActivityType: "Labor",
Employee: {
EmployeeKey: 32,
FirstName: "Mark",
MiddleName: "A.",
LastName: "Royce"
},
EmployeeTypeKey: 3,
EmployeeTypeDescription: "Senior Architect",
Reference: "",
PercentDistribution: 0.0,
Units: 60.0,
CostRate: 40.3831,
CostAmount: 2422.99,
FeeRate: 105.0,
FeeAmount: 6300.0,
MarkupRate: 0.0,
BeginBalanceCostAmount: 0.0,
BeginBalanceFeeAmount: 0.0
}
],
},
Errors: [],
Message: "Success",
ResponseCode: 200,
UsageKey: "6e983af4-946f-4947-9fbd-a233f796f6b4"
}
Update ProjectsPOST/AjeraAPI.ashx?{id}
Updates in V2 are changing and will only allow the updating of objects and not create. To create a new project, phase or invoice group you must use a seperate Create method, see Create Projects
The UpdateProjects method in v2 follow the same rules of requiring all the fields for the unchaged data set, but the UpdateProjects data only needs to contain the objects and fields you want to change.
For example if I wanted to change a projects name this object might look like this:
{
Method: "UpdateProjects",
MethodArguments: {
UpdatedProjects: [
{
ProjectKey: 1,
Description: "New Project Name"
}
],
UnchangedProjects: [
//Results from GetProjects
]
}
}
Each object type for Project, Phase, Invoice Group and Resource has a key field that is required for the update to work. See this table for the key fields for each object type:
Object Type | Key Field |
---|---|
Project | ProjectKey |
Phase | PhaseKey |
Invoice Group | InvoiceGroupKey |
Resource | ResourceKey |
The use of negative keys in v2 have been removed and will not work.
Example URI
- id
string
(required) Example: ew0KICAiRGF0YWJhc2VOYW1lIjogIkFqZXJhX01haW4iDQp9An unique identifier required for api access.
UpdateProjects
Headers
Content-Type: application/json
Body
{
"Method": "UpdateProjects",
"SessionToken": "",
"MethodArguments": {
"UpdatedProjects": [
{
"ProjectKey": 1,
"Description": "New Project Description",
},
{
"InvoiceGroupKey": 1,
"Description": "New Invoice Group Description",
},
{
"PhaseKey": 1,
"Description": "New Phase Description",
}
],
"UnchangedProjects: {
//Content output from GetProjects
}
}
}
200
Headers
Content-Type: application/json
Body
{
ResponseCode: 200,
Message: "Success",
Errors: [],
Content: {
// If no errors have occured then the output will
// be the same as GetProjects. This can be useful
// if you want to update a project and then get the
// updated project without making another
// call to GetProjects.
},
UsageKey: "6e983af4-946f-4947-9fbd-a233f796f6b4"
}
Create ProjectsPOST/AjeraAPI.ashx?{id}
To update fields of a project see UpdateProjects
This method will create a new project objects. It currently supports creating, Projects, Invoice Groups, and Phases.
Some List methods may be required in order to create a record.
NOTE: These list methods will not work in version 2.0 of the API Session.
ListClients
ListCompanies
ListInvoiceFromats
ListRateTable
Example URI
- id
string
(required) Example: ew0KICAiRGF0YWJhc2VOYW1lIjogIkFqZXJhX01haW4iDQp9An unique identifier required for api access.
Creating Projects
Headers
Content-Type: application/json
Body
{
"Method": "CreateProjects",
"MethodArguments": {
"CreateType": "Project",
"Project": {
"Description": "project description", // string, required, max (80 characters)
"CompanyKey": 1, // int, required if multi-company is enabled, otherwise optional
"RateTableKey": 4, // int, required
"BillingType": "TimeAndExpense" //string (Null, TimeAndExpense, FixedFee, PercentComplete, UnitPrice, PercentofConstructionCost, Nonbillable, Marketing, Overhead, Adjustment)",
},
InvoiceGroups: [
{
"Description": "invoice group description", // string, required, max (80 characters)
"ClientKey": 4, // int, required
"InvoiceFormatKey": 1 // int, required
}
],
Phases: [
{
"Description": "string, required, max (80 characters)"
}
]
}
}
Creating Invoice Groups
Headers
Content-Type: application/json
Body
{
"Method": "CreateProjects",
"MethodArguments": {
"CreateType": "InvoiceGroup",
"InvoiceGroups": [
{
"ProjectKey": 156, // int, required
"Description": "invoice group description", // string, required, max (80 characters)
"ClientKey": 4, // int, required
"InvoiceFormatKey": 1 // int, required
}
],
"Phases": [
{
"Description": "phase description", // string, required, max (80 characters)
"RateTableKey": 4 // int, required
}
]
}
}
Creating Phases
Headers
Content-Type: application/json
Body
{
"Method": "CreateProjects",
"MethodArguments": {
"CreateType": "Phase",
"Phases": [
{
"ProjectKey": 156, // int, required
"InvoiceGroupKey": 40, // int, required
"ParentKey": 1, // int, optional (if not provided then the phase will be a top level phase)
"Description": "phase description 2", // string, required, max (80 characters)
"RateTableKey": 4 // int, required
}
]
}
}
Creating Resources
Headers
Content-Type: application/json
Body
{
"Method": "CreateProjects",
"MethodArguments": {
"CreateType": "Resource",
"Phases": [
{
"ParentKey": 1, // int, required, the key of the phase or project that the resource will be added to
"Status": "Null", // enum, not supported
"Priority": "Null", // enum, not supported"
"IsTask": false, // bool, must be false, true is currently not supported
"ActivityType": "Labor", // string, required, enum (Labor, Expense, Consultant)
"EmployeeKey": 26 // int, see List Employees API call to get a list of employees, supported if ActivityType is Labor
"EmployeeTypeKey": 2, // int, see List Employee Types API call to get a list of employee types, supported if ActivityType is Labor
"VendorKey": 1 // int, see List Vendors API call to get a list of vendors, supported if ActivityType is Expense or Consultant
"ActivityKey": 1 // int, see List Activities API call to get a list of activities, supported if ActivityType is Expense
"VendorTypeKey": 1, // int, see List Vendor Types API call to get a list of vendor types, supported if ActivityType is Consultant"
"PercentDistribution": 0.0, // decimal, optional, must be between 0 and 100
//Values below are used as is, they are not validated, if there are nuances to the values then they should be validated before sending them to the API
//You can also omit these values and click the calculate button in PCC to have the values calculated for you
"Units": 30.0, // decimal
"CostRate": 28.845, // decimal
"CostAmount": 865.35, // decimal
"FeeRate": 112.4956, // decimal
"FeeAmount": 3374.87 // decimal
"MarkupRate": 0.0, // decimal
"BeginBalanceCostAmount": 0.0, // decimal
"BeginBalanceFeeAmount": 0.0 // decimal
}
]
}
}