Back to top

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
Projects 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 ExpenseReports
POST/AjeraAPI.ashx?{id}

ListExpenseReports returns an array of Expense Reports, limited by the optional filters detailed below.

Each returned Expense Report includes only very basic information. This method is intended to be used for querying Expense Reports for particular key values, which can then be passed to GetExpenseReports for more detailed information.

NOTE: This method is only accessible when Authorizing Employee is set and is an active employee.

Example URI

POST /AjeraAPI.ashx?ew0KICAiRGF0YWJhc2VOYW1lIjogIkFqZXJhX01haW4iDQp9
URI Parameters
HideShow
id
string (required) Example: ew0KICAiRGF0YWJhc2VOYW1lIjogIkFqZXJhX01haW4iDQp9

An unique identifier required for api access.

Request  ListExpenseReports
HideShow
Headers
Content-Type: application/json
Accept: application/json
Body
{
    Method: "ListExpenseReports",
    SessionToken: "",
    MethodArguments: {
        FilterByEmployee: deprecated: this automatically filled with the current logged in user or authorized user,
        FilterByCompany: [1, 2, 3],
        FilterBySupervisor: [1, 2, 3],
        FilterByIsProcessed: true,
        FilterByNameLike: "string",
        FilterByEarliestBeginningDate: "2015-03-11 16:22:54.229 GMT-0700",
        FilterByLatestBeginningDate: "2015-03-11 16:22:54.229 GMT-0700",
        FilterByEarliestModifiedDate: "2015-03-11 16:22:54.229 GMT-0700",
        FilterByLatestModifiedDate: "2015-03-11 16:22:54.229 GMT-0700",
        FilterByEarliestEndingDate: "2015-03-11 16:22:54.229 GMT-0700",
        FilterByLatestEndingDate: "2015-03-11 16:22:54.229 GMT-0700"
    }
}
Schema
{
    Method: "string, required",
    SessionToken: "string",
    MethodArguments: {
        FilterByEmployee: deprecated: this automatically filled with the current logged in user or authorized user,
        FilterByCompany: "int array, optional",
        FilterBySupervisor: "int array, optional",
        FilterByIsProcessed: "boolean, optional", 
        FilterByNameLike: "string, optional",
        FilterByEarliestBeginningDate: "date string, optional",
        FilterByLatestBeginningDate: "date string, optional",
        FilterByEarliestModifiedDate: "date string, optional",
        FilterByLatestModifiedDate: "date string, optional",
        FilterByEarliestEndingDate: "date string, optional",
        FilterByLatestEndingDate: "date string, optional"
    }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    ResponseCode: 200,
    Message: "Success",
    Errors: [],
    Content: {
        ExpenseReports: [
            {
                ExpenseReportKey: 3,
                CompanyKey: 2,
                Description: "Description",
                BeginningDate: "2015-11-11",
                EndingDate: "2016-01-01",
                IsProcessed: false,
                Status: "SupervisorApproved"
            }
        ]
    },
    UsageKey: "6e983af4-946f-4947-9fbd-a233f796f6b4"
}
Schema
{
    ResponseCode: {
            type: int
        },
    Message: {
            type: "string"
        },
    Errors: {
            type: "array"
        },
    Content: {
        type: "object",
        properties: {
            ExpenseReports: {
                type: "object array",
                properties: {
                    ExpenseReportKey: {
                        type: int
                    },
                    CompanyKey: {
                        type: int
                    },
                    Description: {
                        type: "string"
                    },
                    BeginningDate: {
                        type: "string"
                    },
                    EndingDate: {
                        type: "string"
                    },
                    IsProcessed: {
                        type: boolean
                    },
                    Status: {
                        type: "string" ('In Progress', 'Submitted', 'Supervisor Approved', 'Accounting Approved', 'Processed')
                    }
                }
            }
        }
    },
    UsageKey: {
            type: "guid"
        }
    }
}

Get ExpenseReports
POST/AjeraAPI.ashx?{id}

GetExpenseReports takes one or more key values, and returns an array of matching Expense Reports.

This method returns detailed information, which can be used to populate required fields when calling UpdateExpenseReports.

NOTE: This method can only read expense report’s for which the authorized employee has made. For example if your using an api user which John Doe is the authroized employee, then this method can only read expense reports that have been created by John Doe. If an expense report was made by Jane Doe then John Doe can’t read Jane Doe’s expense report.

NOTE: This method is only accessible when Authorizing Employee is set and is an active employee.

Example URI

POST /AjeraAPI.ashx?ew0KICAiRGF0YWJhc2VOYW1lIjogIkFqZXJhX01haW4iDQp9
URI Parameters
HideShow
id
string (required) Example: ew0KICAiRGF0YWJhc2VOYW1lIjogIkFqZXJhX01haW4iDQp9

An unique identifier required for api access.

Request  GetExpenseReports
HideShow
Headers
Content-Type: application/json
Accept: application/json
Body
{
    Method: "ListExpenseReports",
    SessionToken: "",
    MethodArguments: {
        RequestedExpenseReports: [1, 2, 3] 
    }
}
Schema
{
    Method: "string, required",
    SessionToken: "string",
    MethodArguments: {
        RequestedExpenseReports: "int array, required"
    }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    ResponseCode: 200,
    Message: "Success",
    Errors: [],
    ExpenseReports: [
        {
            ExpenseReportKey: 2,
            LastModifiedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
            IsProcessed: false,
            BeginningDate: "2015-03-11",
            EndingDate: "2015-03-11",
            Description: "",
            AdvanceAmount: 44.3,
            TotalAmount: 100.2,
            SubmittedByEmployeeKey: 1,
            SubmittedByEmployeeName: "Mike Smith",
            SubmittedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
            SupervisorApprovedByEmployeeKey: 1,
            SupervisorApprovedByEmployeeName: "Mike Smith",
            SupervisorApprovedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
            AccountingApprovedByEmployeeKey: 1,
            AccountingApprovedByEmployeeName: "Mike Smith",
            AccountingApprovedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
            Status: "In Progress",
            Notes: "",
            NeedsReApproval: false,
            ReApprovedBy: 1,
            ReApprovedDateTime: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
            Expenses: [
               {
                  ExpenseKey: 1,
                  Date: "2015-03-11",
                  ActivityKey: 1,
                  Attachments: [ 
                    {
                        FileKey: 51,
                        Filename: "reciept1.pdf",
                        Description: "Store 1 Purchases",
                        MimeType: "application/pdf"
                    },
                    {
                        FileKey: 52,
                        Filename: "reciept2.pdf",
                        Description: "Store 2 Purchases",
                        MimeType: "application/pdf"
                    }
                  ]
                  ActivityDescription: "Photos",
                  ProjectKey: 1,
                  ProjectName: "Z-Overhead",
                  PhaseKey: 1,
                  PhaseName: "Administration",
                  IsUnitBased: true,
                  Units: 1,
                  UnitRate: 12.2,
                  CostAmount: 11.1,
                  BankAccountKey: 4,
                  CreditCardName: "American Express Card",
                  RejectedByByEmployeeKey: 1,
                  RejectedByByEmployeeName: "Mike Smith",
                  Payee: "",
                  IsPersonalExpense: false,
                  Reference: "",
                  ManagerNotes: "",
                  Notes: "",
                  ProjectInfoValid: false
               }
            ]
        }
    ],
    UsageKey: "6e983af4-946f-4947-9fbd-a233f796f6b4"
}
Schema
{
    ResponseCode: {
        type: int
    },
    Message: {
        type: "string"
    },
    Errors: {
        type: "array"
    },
    ExpenseReports: {
        type: "object array",
        properties: {
            ExpenseReportKey: {
                type: int
            },
            LastModifiedDate: {
                type: "string"
            },
            IsProcessed: {
                type: boolean
            },
            BeginningDate: {
                type: "string"
            },
            EndingDate: {
                type: "string"
            },
            Description: {
                type: "string"
            },
            AdvanceAmount: {
                type: decimal
            },
            TotalAmount: {
                type: decimal
            },
            SubmittedByEmployeeKey: {
                type: int
            },
            SubmittedByEmployeeName: {
                type: string
            },
            SubmittedDate: {
                type: "string"
            },
            SupervisorApprovedByEmployeeKey: {
                type: int
            },
            SupervisorApprovedByEmployeeName: {
                type: string
            },
            SupervisorApprovedDate: {
                type: "string"
            },
            AccountingApprovedByEmployeeKey: {
                type: int
            },
            AccountingApprovedByEmployeeName: {
                type: string
            },
            AccountingApprovedDate: {
                type: "string"
            },
            Status: {
                type: "string" ('In Progress', 'Submitted', 'Supervisor Approved', 'Accounting Approved', 'Processed')
            },
            Notes: {
                type: "string"
            },
            NeedsReApproval: {
                type: boolean
            },
            ReApprovedBy: {
                type: int
            },
            ReApprovedDateTime: {
                type: "string"
            },
            Expenses: {
                type: "object array",
                properties: {
                    ExpenseKey: {
                        type: int
                    },
                    Attachments: {
                        type: array - 1 or more items
                        properties: {
                            FileKey: {
                                type: int
                            },
                            Filename: {
                                type: string
                            },
                            Description: {
                                type: string
                            },
                            MimeType: {
                                type: string
                            }
                        }
                    }
                    Date: {
                        type: "string"
                    },
                    ActivityKey: {
                        type: int
                    },
                    ActivityDescription: {
                        type: string
                    },
                    ProjectKey: {
                        type: int
                    },
                    ProjectName: {
                        type: string
                    },
                    PhaseKey: {
                        type: int
                    },
                    PhaseName: {
                        type: string
                    },
                    IsUnitBased: {
                        type: boolean
                    },
                    Units: {
                        type: int
                    },
                    UnitRate: {
                        type: decimal
                    },
                    CostAmount: {
                        type: decimal
                    },
                    BankAccountKey: {
                        type: int
                    },
                    CreditCardName: {
                        type: string
                    },
                    RejectedByByEmployeeKey: {
                        type: int
                    },
                    RejectedByByEmployeeName: {
                        type: string
                    },
                    Payee: {
                        type: "string"
                    },
                    IsPersonalExpense: {
                        type: boolean
                    },
                    Reference: {
                        type: "string"
                    },
                    Notes: {
                        type: "string"
                    },
                    ManagerNotes: {
                        type: "string"
                    },
                    ProjectInfoValid: {
                        type: "boolean, not always present:
                            true: project info on expense is valid
                            false: project info on expense is invalid
                            not present: if there is not project info then this field will not be present"
                    }
                }
            }
        }
    },
    UsageKey: {
        type: "guid"
    }
}

Update ExpenseReports
POST/AjeraAPI.ashx?{id}

UpdateExpenseReports is used to update, create or delete Expense Reports.

To create expense reports, UnchangedExpenseReports is set to empty, and UpdatedExpenseReports items are given an ExpenseReportKey with a negative value.

To update or delete expense reports, UnchangedExpenseReports must be provided with all fields populated with current data, most likely obtained from calling GetExpenseReports.

• Expense reports are available to any employee that is marked to use expense reports in Ajera.

• Any expense report can be deleted as long as it has not been submitted by the employee.

• The expense report API consists of the expense report and detail rows associated with the expense report.

• When creating a new expense report, it is associated with the authorized user set on the API user setup screen.

NOTE: This method can only update expense report’s for which the authorized employee has made. For example if your using an api user which John Doe is the authroized employee, then this method can only update expense reports that have been created by John Doe. If an expense report was made by Jane Doe then John Doe can’t edit Jane Doe’s expense report.

NOTE: This method is only accessible when Authorizing Employee is set and is an active employee.

Example URI

POST /AjeraAPI.ashx?ew0KICAiRGF0YWJhc2VOYW1lIjogIkFqZXJhX01haW4iDQp9
URI Parameters
HideShow
id
string (required) Example: ew0KICAiRGF0YWJhc2VOYW1lIjogIkFqZXJhX01haW4iDQp9

An unique identifier required for api access.

Request  UpdateExpenseReports
HideShow
Headers
Content-Type: application/json
Accept: application/json
Body
{
    Method: "UpdateExpenseReports",
    SessionToken: "",
    MethodArguments: {
        UpdatedExpenseReports: [
           {
              ExpenseReportKey: 1,
              Delete: false,
              Submit: true,
              LastModifiedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
              IsProcessed: false,
              BeginningDate: "2015-03-11",
              EndingDate: "2015-03-11", 
              Description: "",
              AdvanceAmount: 44.3,
              TotalAmount: 100.2,
              SubmittedByEmployeeKey: 1,
              SubmittedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
              SupervisorApprovedByEmployeeKey: 1,
              SupervisorApprovedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
              AccountingApprovedByEmployeeKey: 1,
              AccountingApprovedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
              Notes: "",
              Expenses: [
                 {
                    ExpenseKey: 1,
                    Attachments: [
                        {
                            FileKey: 1,
                            Description: "Change 1"
                        },
                        {
                            FileKey: 2,
                            Description: "Change 2"
                        }
                    ]
                    Date: "2015-03-11",
                    Delete: false,
                    ActivityKey: 1,
                    ProjectKey: 1,
                    PhaseKey: 1,
                    Units: 1,
                    UnitRate: 12.2,
                    CostAmount: 11.1,
                    BankAccountKey: 1,
                    RejectedByByEmployeeKey: 2,
                    Payee: "Bob",
                    IsPersonalExpense: false,
                    Reference: "",
                    ManagerNotes: "mgr notes",
                    Notes: ""
                 }
              ]
           }
        ],
        UnchangedExpenseReports: [
            {
              ExpenseReportKey: 1,
              LastModifiedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
              IsProcessed: false,
              BeginningDate: "2015-03-11",
              EndingDate: "2015-03-11", 
              Description: "",
              AdvanceAmount: 44.3,
              TotalAmount: 100.2,
              SubmittedByEmployeeKey: 1,
              SubmittedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
              SupervisorApprovedByEmployeeKey: 1,
              SupervisorApprovedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
              AccountingApprovedByEmployeeKey: 1,
              AccountingApprovedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
              Notes: "",
              Expenses: [
                 {
                    ExpenseKey: 1,
                    Date: "2015-03-11",
                    ActivityKey: 1,
                    ProjectKey: 1,
                    PhaseKey: 1,
                    Units: 1,
                    UnitRate: 12.2,
                    CostAmount: 11.1,
                    BankAccountKey: 1,
                    RejectedByByEmployeeKey: 2,
                    Payee: "Bob",
                    IsPersonalExpense: false,
                    Reference: "",
                    ManagerNotes: "",
                    Notes: ""
                 }
              ]
           }
        ],
        UseSingleTransaction: false
    }
}
Schema
{
    Method: "string, required",
    SessionToken: "string",
    MethodArguments: {
        UpdatedExpenseReports: "object array, required" {
            ExpenseReportKey: "int, required (negative value indicates that this is a create request)",
            LastModifiedDate: "string, date time format, required",
            Submit: "bool, optional, flag to indicate you want to submit expense report, if allowed"
            Delete: "bool, optional, flag as a delete request, in which case only ExpenseReportKey, LastModifiedDate required",
            IsProcessed: "bool, optional, read only, (this is marked when the correct approval level has been reached on the expense report)",
            BeginningDate: "string, date only format, optional, nullable",
            EndingDate: "string, date only format, optional, nullable, (cannot be before beginning balance for employee's company)",
            Description: "string, optional, max(80 characters)",
            AdvanceAmount: "decimal(19,2), optional",
            TotalAmount: "decimal(19,2), optional, (calculated as total of all the expense items less personal and advance)",
            SubmittedByEmployeeKey: "int, optional, nullable, (filled in with employee key once the employee submits this)",
            SubmittedDate: "string, date time format, optional, nullable",
            SupervisorApprovedByEmployeeKey: "int, optional, nullable, (filled in with supervisor employee key when approved)",
            SupervisorApprovedDate: "string, date time format, optional, nullable",
            AccountingApprovedByEmployeeKey: "int, optional, nullable, (filled in with accounting employee key when approved)",
            AccountingApprovedDate: "string, date time format, optional, nullable",
            Notes: "string, optional, no max",
            Expenses: [
                {
                    ExpenseKey: "int, required, if attaching attachments this key must match the key used when saving the attachment",
                    Date: "date only",
                    Delete: "bool, optional, flag as a delete request, which will delete this expense line"
                    Attachments: [
                        {
                            FileKey: "int, required if changing description or you have saved attachments prior to saving this record",
                            Description: "string, optional"
                        }
                    ],
                    ActivityKey: "int, required",
                    ProjectKey: "int, optional, nullable",
                    PhaseKey: "int, optional, nullable, (required if ProjectKey specified)",
                    Units: "decimal(19,2), optional, defaults to 0",
                    UnitRate: "decimal(19,2), optional, nullable",
                    CostAmount: "decimal(19,2), optional, (if not supplied this value will be calcluated)",
                    BankAccountKey: "int, optional, nullable",
                    RejectedByByEmployeeKey: "int, optional, nullable",
                    Payee: "string, max(255 characters), optional",
                    IsPersonalExpense: "bool, optional, defaults to false",
                    Reference: "string, optional, max(80 characters)",
                    ManagerNotes: "string, no max",
                    Notes: "string, no max"
                }
            ]
        },
        UnchangedExpenseReports: "object array, required (all fields are required in Unchanged set)" {
            ExpenseReportKey: "int",
            LastModifiedDate: "string, date time format",
            IsProcessed: "bool, (this is marked when the correct approval level has been reached on the expense report)",
            BeginningDate: "string, date only format, nullable",
            EndingDate: "string, date only format, nullable, (cannot be before beginning balance for employee's company)",
            Description: "string, max(80 characters)",
            AdvanceAmount: "decimal(19,2)",
            TotalAmount: "decimal(19,2), (calculated as total of all the expense items less personal and advance)",
            SubmittedByEmployeeKey: "int, nullable, (filled in with employee key once the employee submits this)",
            SubmittedDate: "string, date time format, nullable",
            SupervisorApprovedByEmployeeKey: "int, nullable, (filled in with supervisor employee key when approved)",
            SupervisorApprovedDate: "string, date time format, nullable",
            AccountingApprovedByEmployeeKey: "int, nullable, (filled in with accounting employee key when approved)",
            AccountingApprovedDate: "string, date time format, nullable",
            Notes: "string, no max",
            Expenses: [
                {
                    ExpenseKey: "int",
                    Date: "date only",
                    ActivityKey: "int",
                    ProjectKey: "int, nullable",
                    PhaseKey: "int, nullable, (required if ProjectKey specified)",
                    Units: "int, defaults to 0",
                    UnitRate: "decimal(19,2), nullable",
                    CostAmount: "decimal(19,2)",
                    BankAccountKey: "int, nullable",
                    RejectedByByEmployeeKey: "int, optional, nullable",
                    Payee: "string, max(255 characters)",
                    IsPersonalExpense: "bool, defaults to false",
                    Reference: "string, max(80 characters)",
                    ManagerNotes: "string, no max",
                    Notes: "string, no max"
                }
            ]
        },
        UseSingleTransaction: "boolean, optional"
    }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    ResponseCode: 200,
    Message: "Success",
    Errors: [],
    Content: {
        NumberOfExpenseReportsUpdated: 1,
        ExpenseReports: [
           {
              ExpenseReportKey: 1, //Int
              LastModifiedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
              IsProcessed: false,
              BeginningDate: "2015-03-11",
              EndingDate: "2015-03-11", 
              Description: "",
              AdvanceAmount: 44.3,
              TotalAmount: 100.2,
              SubmittedByEmployeeKey: 1,
              SubmittedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
              SupervisorApprovedByEmployeeKey: 1,
              SupervisorApprovedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
              AccountingApprovedByEmployeeKey: 1,
              AccountingApprovedDate: "2015-03-11 16:22:54.229 GMT-0700 (Pacific Daylight Time)",
              Notes: "",
              Expenses: [
                 {
                    ExpenseKey: 1,
                    Date: "2015-03-11",
                    ActivityKey: 1,
                    ProjectKey: 1,
                    PhaseKey: 1,
                    Units: 1,
                    UnitRate: 12.2,
                    CostAmount: 11.1,
                    BankAccountKey: 1,
                    RejectedByByEmployeeKey: 2,
                    Payee: "Bob",
                    IsPersonalExpense: false,
                    Reference: "",
                    ManagerNotes: "mgr notes",
                    Notes: ""
                 }
              ]
           }
        ]
    },
    UsageKey: "6e983af4-946f-4947-9fbd-a233f796f6b4"
}

// Error response example: EndingDate left blank:

Error #0   ##########################
{
  "ErrorID": -420,
  "ErrorMessage": "Required property is missing or invalid.",
  "ErrorData": {
    "EndingDate": "",
    "ExpenseReportKey": 11,
    "ExpenseReport": {
      "ExpenseReportKey": 11,
      "LastModifiedDate": "2016-11-13 22:23:59.537 GMT-08:00 (Pacific Standard Time)",
      "Description": "",
      "IsProcessed": false,
      "BeginningDate": "2015-03-11",
      "EndingDate": "",
      "AdvanceAmount": 44.3,
      "TotalAmount": 11.3,
      "SubmittedByEmployeeKey": null,
      "SubmittedByEmployeeName": null,
      "SubmittedDate": null,
      "SupervisorApprovedByEmployeeKey": null,
      "SupervisorApprovedByEmployeeName": null,
      "SupervisorApprovedDate": null,
      "AccountingApprovedByEmployeeKey": null,
      "AccountingApprovedByEmployeeName": null,
      "AccountingApprovedDate": null,
      "Status": "In Progress",
      "Notes": "",
      "Expenses": [
        {
          "ExpenseKey": 4053,
          "Date": "2015-03-11",
          "ActivityKey": 1,
          "ActivityDescription": "Project Management",
          "IsUnitBased": false,
          "ProjectKey": 1,
          "ProjectName": "Lightrail Expansion - Irvington",
          "PhaseKey": 1,
          "PhaseName": "Lightrail Expansion - Irvington",
          "Units": 2,
          "UnitRate": 12.2,
          "CostAmount": 11.3,
          "BankAccountKey": 1,
          "CreditCardName": "Chase",
          "RejectedByEmployeeKey": null,
          "RejectedByEmployeeName": null,
          "Payee": "Bob",
          "IsPersonalExpense": false,
          "Reference": "",
          "ManagerNotes": "",
          "Notes": "",
          "ProjectInfoValid": false
        }
      ]
    }
  },
  "ErrorObj": {
    "PropertyWithIssue": "EndingDate"
  }
}

// Error response example: ActivityKey set to 'abc' rather than an integer key:
Error #1   ##########################
{
  "ErrorID": -200,
  "ErrorMessage": "One or more properties contain invalid data.",
  "ErrorData": {
    "ActivityKey": "abc",
    "Expense": {
      "ExpenseKey": 4053,
      "Date": "2015-03-11",
      "ActivityKey": "abc",
      "ActivityDescription": "Vacation",
      "IsUnitBased": false,
      "ProjectKey": 1,
      "ProjectName": "Lightrail Expansion - Irvington",
      "PhaseKey": 1,
      "PhaseName": "Lightrail Expansion - Irvington",
      "Units": 2,
      "UnitRate": 12.2,
      "CostAmount": 11.3,
      "BankAccountKey": 1,
      "CreditCardName": "Chase",
      "RejectedByEmployeeKey": null,
      "RejectedByEmployeeName": null,
      "Payee": "Bob",
      "IsPersonalExpense": false,
      "Reference": "",
      "ManagerNotes": "",
      "Notes": "",
      "ProjectInfoValid": false
    },
    "ExpenseReportKey": 11,
    "ExpenseReport": {
      "ExpenseReportKey": 11,
      "LastModifiedDate": "2016-11-14 08:55:54.987 GMT-08:00 (Pacific Standard Time)",
      "Description": "",
      "IsProcessed": false,
      "BeginningDate": "2015-03-11",
      "EndingDate": "2015-03-11",
      "AdvanceAmount": 44.3,
      "TotalAmount": 11.3,
      "SubmittedByEmployeeKey": null,
      "SubmittedByEmployeeName": null,
      "SubmittedDate": null,
      "SupervisorApprovedByEmployeeKey": null,
      "SupervisorApprovedByEmployeeName": null,
      "SupervisorApprovedDate": null,
      "AccountingApprovedByEmployeeKey": null,
      "AccountingApprovedByEmployeeName": null,
      "AccountingApprovedDate": null,
      "Status": "In Progress",
      "Notes": "",
      "Expenses": [
        {
          "ExpenseKey": 4053,
          "Date": "2015-03-11",
          "ActivityKey": "abc",
          "ActivityDescription": "Vacation",
          "IsUnitBased": false,
          "ProjectKey": 1,
          "ProjectName": "Lightrail Expansion - Irvington",
          "PhaseKey": 1,
          "PhaseName": "Lightrail Expansion - Irvington",
          "Units": 2,
          "UnitRate": 12.2,
          "CostAmount": 11.3,
          "BankAccountKey": 1,
          "CreditCardName": "Chase",
          "RejectedByEmployeeKey": null,
          "RejectedByEmployeeName": null,
          "Payee": "Bob",
          "IsPersonalExpense": false,
          "Reference": "",
          "ManagerNotes": "",
          "Notes": "",
          "ProjectInfoValid": false
        }
      ]
    }
  },
  "ErrorObj": {
    "PropertyWithIssue": "ActivityKey",
    "Index": 0,
    "TypeOfIssue": "Data Type"
  }
}
Schema
{
    ResponseCode: {
        type: int
    },
    Message: {
        type: "string"
    },
    Errors: {
        type: "array"
    },
    Content : {
        NumberOfExpenseReportsUpdated: {
            type: int
        },
        ExpenseReports: {
            type: "object array",
            properties: {
                ExpenseReportKey: {
                    type: int
                },
                LastModifiedDate: {
                    type: "string"
                },
                IsProcessed: {
                    type: boolean
                },
                BeginningDate: {
                    type: "string"
                },
                EndingDate: {
                    type: "string"
                },
                Description: {
                    type: "string"
                },
                AdvanceAmount: {
                    type: decimal
                },
                TotalAmount: {
                    type: decimal
                },
                SubmittedByEmployeeKey: {
                    type: int
                },
                SubmittedDate: {
                    type: "string"
                },
                SupervisorApprovedByEmployeeKey: {
                    type: int
                },
                SupervisorApprovedDate: {
                    type: "string"
                },
                AccountingApprovedByEmployeeKey: {
                    type: int
                },
                AccountingApprovedDate: {
                    type: "string"
                },
                Notes: {
                    type: "string"
                },
                Expenses: {
                    type: "object",
                    properties: {
                        ExpenseKey: {
                            type: int
                        },
                        Date: {
                            type: "string"
                        },
                        ActivityKey: {
                            type: int
                        },
                        ProjectKey: {
                            type: int
                        },
                        PhaseKey: {
                            type: int
                        },
                        Units: {
                            type: int
                        },
                        UnitRate: {
                            type: decimal
                        },
                        CostAmount: {
                            type: decimal
                        },
                        Payee: {
                            type: "string"
                        },
                        IsPersonalExpense: {
                            type: boolean
                        },
                        Reference: {
                            type: "string"
                        },
                        Notes: {
                            type: "string"
                        }
                    }
                }
            }
        }
    },
    UsageKey: {
        type: "guid"
    }
}

Upload ExpenseReports
POST/AjeraAPI.ashx?{id}

UploadExpenseReports returns a 200 ResponseCode on success, nothing else is returned unless an error has occurred

• Operation only allows for a single upload at a time

NOTE: This method is only accessible when Authorizing Employee is set and is an active employee.

Example URI

POST /AjeraAPI.ashx?ew0KICAiRGF0YWJhc2VOYW1lIjogIkFqZXJhX01haW4iDQp9
URI Parameters
HideShow
id
string (required) Example: ew0KICAiRGF0YWJhc2VOYW1lIjogIkFqZXJhX01haW4iDQp9

An unique identifier required for api access.

Request  UploadExpenseReports
HideShow
Headers
Content-Type: application/json
Accept: application/json
Body
{
    Method: "ListExpenseReports",
    SessionToken: "",
    MethodArguments: {
        ExpenseKey: 4071,
        FileKey:    1,
        FileKeys:   [1, 2],
        Delete:     false,
        Filename:   "attachment.pdf",
        Description:"Store 1 Purchases",
        MimeType:   "application/pdf",
        FileData:   "SSBMb3ZlIFN0YXIgV2Fycw=="
    }
}
Schema
{
    Method: "string, required",
    SessionToken: "string",
    MethodArguments: {
        ExpenseKey: "int, required, not required if Delete is true, also known as the Transaction Key, this key must belong to an expense report", 
        Delete:     "bool, required if deleting, otherwise optional, indicates deletion of attachment"
        FileKey:    "int, required if Delete is true and only deleting one record, file key to delete"
        FileKeys:   "int, required if Delete is true and deleting more than one record, file keys to delete"
        Filename:   "string, required, not required if Delete is true, the full path of the filename, filename without path is also allowed",
        Description:"string, required, not required if Delete is true, description given by user to describe attachment",
        MimeType:   "string, required, not required if Delete is true, the mime type of the file being sent",
        FileData:   "string, required, not required if Delete is true, a base64 string of the contents of the file being sent", 
    }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    ResponseCode: 200,
    Message: "Success",
    Content: {
        FileKey: 95
    }
    Errors: [],
    UsageKey: "6e983af4-946f-4947-9fbd-a233f796f6b4"
}
Schema
{
    ResponseCode: {
        type: int
    },
    Message: {
        type: "string"
    },
    Content: {
        FileKey: {
            type: int
        }
    },
    Errors: {
        type: "array"
    },
    UsageKey: {
        type: "guid"
    }
}

Download ExpenseReports
POST/AjeraAPI.ashx?{id}

DownloadExpenseReports returns a 200 ResponseCode on success.

• Operation allows for only a single download at a time.

NOTE: This method is only accessible when Authorizing Employee is set and is an active employee.

Example URI

POST /AjeraAPI.ashx?ew0KICAiRGF0YWJhc2VOYW1lIjogIkFqZXJhX01haW4iDQp9
URI Parameters
HideShow
id
string (required) Example: ew0KICAiRGF0YWJhc2VOYW1lIjogIkFqZXJhX01haW4iDQp9

An unique identifier required for api access.

Request  UploadExpenseReports
HideShow
Headers
Content-Type: application/json
Accept: application/json
Body
{
    Method: "ListExpenseReports",
    SessionToken: "",
    MethodArguments: {
        FileKey: 51
    }
}
Schema
{
    Method: "string, required",
    SessionToken: "string",
    MethodArguments: {
        FileKey: "int, required, Key to file attachment map table"
    }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    ResponseCode: 200,
    Message: "Success",
    Content: {
        FileData: string, base64 string of the file that was uploaded,
        Filename: string, filename given when file was uploaded,
        MimeType: string, MimeType if it was provided during upload.
    }
    Errors: [],
    UsageKey: "6e983af4-946f-4947-9fbd-a233f796f6b4"
}
Schema
{
    ResponseCode: {
            type: int
        },
    Message: {
            type: "string"
        },
    Errors: {
            type: "array"
        },
    UsageKey: {
            type: "guid"
        }
    }
}

Generated by aglio on 26 Jul 2021