Back to top

Ajera API

message for Ajera API general doc

NOTE: When creating one or more records all Keys in question must be negative and different
NOTE: for new records. Also note that if a record contains other records within the same record,
NOTE: it’s best to use different negative keys just as a rule of thumb. For example when creating
NOTE: Projects that contain Phases and other items make sure every time you enter a negative key,
NOTE: make sure that the key used is different from every other negative key referenced.
NOTE: obviously if your trying to reference a record within a new record that exists that key must
NOTE: not be negative.

NOTE: These notes apply to all Update/Write API methods.

For additional api methods see the following below:


Version 2.0
Projects API
Vendor Invoices API


Version 1.0
Clients API
Contacts API
Employees API
Vendors API
Projects API
Expense Reports API
GL Accounts API
Various List Methods


Paging List Methods

Most list methods can be paged by adding PageResults property to the request body. The default value for PageResults is false. To specify the page number and page size, add PageNumber and PageSize properties to the request body.
The default value for PageNumber is 1 and the default value for PageSize is 10.

Example:

{
  "Method": "ListClients",
  "PageResults": true,
  "PageSize": 10,
  "PageNumber": 1,
  "MethodArguments": {
    ...
  }
}

On the response you will see the following properties:

{
  "ResponseCode": 200,
  "Message": "Success",
  "Errors": [],
  "PageSize": 10,
  "PageNumber": 1,
  "PageCount": 6,
  "Content": {
    ...
  },
  ...
}

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 Menu

Utility -> Setup Integrations -> API Settings

NOTE: You can not access version 1 and version 2 of the API at the same time with the same session.

Create/End API Session
POST/AjeraAPI.ashx?{id}

Blurb about CreateAPISession & EndAPISession

Example URI

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

An unique identifier required for api access.

Request  CreateAPISession
HideShow
Headers
Content-Type: application/json
Accept: application/json
Body
{
   Method: "CreateAPISession",
   Username: "janedoe",
   Password: "j@ned0e",
   APIVersion: 1 or 2,
   UseSessionCookie: false
}
Schema
{
    Method: "string, required",
    Username: "string, max(# characters)",
    Password: "string, max(# characters)",
    APIVersion: "int",
    UseSessionCookie: "boolean"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    Content: {
        EmployeeKey: 1,                 // Ajera logged in users only
        EmployeeName: "Robert Smith",   // Ajera logged in users only
        CanSubmit: true,                // Ajera logged in users only
        CompanyName: "Company One",
        SessionToken: "token",
        APIURL: "http://url/target/?{id}",
        AjeraVersion: "8.10",
        UsingMobileICR: false
    },
    Errors: [],
    Message: "Success",
    ResponseCode: 0,
    UsageKey: "6e983af4-946f-4947-9fbd-a233f796f6b4"
}
Schema
{
    type: "object",
    properties: {
        Content: {
            type: "object",
            properties: {
                EmployeeKey: {
                    type: integer (Ajera logged in users only)
                },
                EmployeeName: {
                    type: "string" (Ajera logged in users only)
                },
                CanSubmit: {
                    type: boolean (Ajera logged in users only)
                },
                CompanyName: {
                    type: "string"
                },
                SessionToken: {
                    type: "string"
                },
                APIURL: {
                    type: "string"
                },
                AjeraVersion: {
                    type: "string"
                }
            }
        },
        Errors: {
            type: "array"
        },
        Message: {
            type: "string"
        },
        ResponseCode: {
            type: int
        },
        UsageKey: {
            type: "guid"
        }
    }
}
Request  EndAPISession
HideShow
Headers
Content-Type: application/json
Body
{
    Method: "EndAPISession",
    SessionToken: "retrieved from a sucessfull call to CreateAPISession"
}
Schema
{
    Medthod: "string, required",
    SessionToken: "string, required"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Content": {
    "message": "You have been successfully signed out."
  },
  "ResponseCode": 0,
  "Message": "Success",
  "Errors": [],
  "UsageKey": "8db15167-36a7-408f-8123-4a3a946a66e2"
}
Schema
{
    type: "object",
    properties: {
        Content: {
            type: "object",
            properties: {
                message: {
                    type: "string"
                }
            }
        },
        Errors: {
            type: "array"
        },
        Message: {
            type: "string"
        },
        ResponseCode: {
            type: int
        },
        UsageKey: {
            type: "guid"
        }
    }

Generated by aglio on 17 Oct 2024