Get a paginated list of projects

Returns a smaller, paginated subset of project data within your ConstructionOnline company account

get https://api.constructiononline.com/api/Projects?skip={skip}&take={take}

Pagination breaks up large datasets into smaller subsets, which minimizes the amount of data loaded at once. This improves overall performance and reduces server load. Using this endpoint, user can extract a paginated subset of their entire project record from ConstructionOnline, which consists of all active and archived projects within their company account and any projects they were added to as a client or sub. Note that this does not include any deleted projects; deleted projects can be obtained separately using the get all deleted projects endpoint.

Requests

REQUIRED PARAMETERS

skip: integer

  • Number of projects you want to skip over
  • For example: if you enter a value of 2 for skip, the endpoint will skip over the first two project objects in your project record

take: integer

  • Number of projects you want to be returned after omitting the skipped projects
  • For example: if you enter a value of 10 for take, the endpoint will only return the 10 project objects that come after the 2 projects that were skipped

❗ To successfully paginate your list of results, values for both 'skip' and 'take' must be entered. You cannot enter a value for just one or the other. 

Sample request URL:

  • https://api.constructiononline.com/api/Projects?skip=2&take=4

Example requests in cURL, C#, Python, and JavaScript can be found below:

cURL

# replace {email} with the email address for your ConstructionOnline account
# {password} with your ConstructionOnline password
# {apikey} with your provided API key
# {skip} with the number of project objects you want to skip
# {take} with the number of project objects you would like to return after the skipped amount

curl https://api.constructiononline.com/api/Projects?skip={skip}&take={take} -u {email}:{password} -H 'APIKey:{apikey}'

C#

/* replace {username} with the email address for your ConstructionOnline account
{password} with your ConstructionOnline password
{apikey} with your provided API key
{skip} with the number of project objects you want to skip
{take} with the number of project objects you would like to return after the skipped amount */

public string GetData(string endpoint) {
string username = "{username}";
string password = "{password}";
string apikey = "{apikey}";
HttpResponseMessage response = null;
HttpClientHandler handler = new HttpClientHandler() { AutomaticDecompression = System.Net.DecompressionMethods.GZip };
    using (HttpClient client = new HttpClient(handler)) {
        client.Timeout = new TimeSpan(0, 0, 30);
        client.BaseAddress = new Uri("http://api.constructiononline.com");
        client.DefaultRequestHeaders.Accept.Clear();
        client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic",
System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(username + ":" + password)));
        client.DefaultRequestHeaders.Add("APIKey", apikey);
        client.DefaultRequestHeaders.Add("Accept-Encoding", "gzip");
        response = client.GetAsync(endpoint).Result;
    }
    return response?.Content.ReadAsStringAsync().Result;
}
MessageBox.Show(GetData("api/Projects?skip={skip}&take={take}"));

Python

#replace {username} with the email address for your ConstructionOnline account
#{password} with your ConstructionOnline password
#{apikey} with your provided API key
#{skip} with the number of project objects you want to skip
#{take} with the number of project objects you would like to return after the skipped amount

import base64, requests, json
apikey = "{apikey}"
username = "{username}"
password = "{password}"
def makeRequest(endpoint):
url = "https://api.constructiononline.com/" + endpoint
userPass = username + ":" + password
headers = {
"APIKey": apikey,
"Accept-Encoding": "gzip, deflate, br",
"Authorization": "Basic " + base64.b64encode(userPass.encode()).decode(),
}
response = requests.get(url, headers=headers)
return json.dumps(json.loads(response.text), indent=2)

#Main Program
print(makeRequest("api/Projects?skip={skip}&take={take}"))

JavaScript

/* replace {username} with the email address for your ConstructionOnline account
{password} with your ConstructionOnline password
{apikey} with your provided API key
          {skip} with the number of project objects you want to skip
{take} with the number of project objects you would like to return after the skipped amount */

username = '{username}';
password = '{password}';
apikey = '{apikey}';
function makeRequest(endpoint) {
    auth = btoa('${username}:${password}');
    var myHeaders = new Headers();
    myHeaders.append("APIKey", apikey);
    myHeaders.append("Accept-Encoding", "gzip, deflate, br");
    myHeaders.append("Authorization", "Basic ${auth}");
    var requestOptions = {
        method: 'GET',
        headers: myHeaders,
        redirect: 'follow'
   };
    fetch("https://api.constructiononline.com/" + endpoint, requestOptions)
        .then(response => response.text())
        .then(result => console.log(result))
        .catch(error => console.log('error', error));
    return response;
};makeRequest("api/Projects?skip={skip}&take={take}");

Responses

green 200: Success

A successful request will return a 200 response with the requested projects in the body, as seen below. Definitions for all returned properties can be found here

{
      "ID": 1265198,
        "NAME": "Downtown Restaurant Relocation",
      "CREATED_BY": 988889,
      "CREATOR_NAME": "Alice Conway",
        "LMOD": "2022-08-04T14:30:56.223",
      "ADDRESS": "1222 E Samford St",
        "CITY": "Auburn",
        "STATE": "AL",
        "ZIP": "36830",
        "PROJECT_NUMBER": "",
      "LMOD_CON_ID": 985313,
      "IS_ARCHIVED": true,
        "CURRENCY": 0,
        "IS_TEMPLATE": false,
        "COUNTRY_SETTING": 1,
        "CUSTOM_COLOR": "#f4a8de",
      "COMPANY_ID": 20000,
        "IS_INACTIVE": false,
        "LAT": 32.479692,
        "LON": -85.499419,
        "SCOPE_OF_WORK": "%3Cp%3ELooking%20for%20a%20new%20restaurant%20space%2C%20wanting%20to%20expand.%26nbsp%3B%3C%2Fp%3E",
        "IS_UNGROUPED": false,
        "TOTAL_TIME": 0,
        "TOTAL_MONEY": 0.0,
        "PROJECT_NOTES": "",
        "NUMBERFOLDERS": 2,
        "NUMBERIMAGES": 0,
        "NUMBERALBUMS": 0,
        "NUMBERFILES": 0,
      "DATE_CREATED": "2022-01-17T16:09:29.94",
      "PROJECT_TYPE_CUSTOM": 390,
        "PROJECT_TYPE": "Commercial",
        "ATTACH_FOLDER_ID": null,
        "PERMISSION_FILES": 65535,
        "PERMISSION_CALENDAR": 3,
        "PERMISSIONS_TIME": 3,
        "PERMISSIONS_TODOS": 3,
        "PERMISSIONS_SCHEDULING": 3,
        "PERMISSIONS_PUNCHLISTS": 3,
        "PERMISSIONS_CHANGEORDERS": 3,
        "PERMISSIONS_SELECTIONS": 3,
        "PERMISSIONS_LOGGING": 3,
        "PERMISSIONS_RFIS": 3,
        "PERMISSIONS_TRANSMITTAL": 3,
        "PERMISSIONS_SUBMITTAL": 3,
        "ESTIMATE_UNQUALIFIED_COMMITS": null,
        "ESTIMATE_UNQUALIFIED_ACTUALS": null,
        "ESTIMATE_UNQUALIFIED_EXPENSES": null,
        "SELECTION_UNQUALIFIED_COMMITS": null,
        "SELECTION_UNQUALIFIED_ACTUALS": null,
        "SELECTION_UNQUALIFIED_EXPENSES": null,
        "CHANGE_ORDER_UNQUALIFIED_COMMITS": null,
        "CHANGE_ORDER_UNQUALIFIED_ACTUALS": null,
        "CHANGE_ORDER_UNQUALIFIED_EXPENSES": null,
        "PRIMARY_SCHEDULE": null,
        "COST_CODE_SET": 2,
        "JOBSITE_INSTRUCTIONS": "",
        "PROJECT_GROUP": 0,
        "PROJECT_STAGE": 1616,
        "PROJECT_CATEGORY": 0,
        "PROJECT_OFFICE": 0,
        "PROJECT_DIVISION": 0,
        "PROJECT_REGION": 0,
        "PERMISSIONS_ESTIMATING": 3,
        "PERMISSIONS_CHECKLISTS": 3
    },

red 404: Error

The server was not able to locate the resource specified in the request.

red 429: Error

The user has surpassed the request rate limit for the hour, day, week, or month.

 red 500: Error

There was an internal server error and the server was unable to complete the request.

My Documents

In addition to your company projects, this endpoint will also return a project object called 'My Documents', which stores specific file information for the user accessing the project record. While 'My Documents' returns as a project object, it is only used to keep track of your personal files and serves as a parent object for files, templates, and other objects in ConstructionOnline. Project-specific properties such as scope of work or address will not contain any data. Multiple instances of 'My Documents' may be returned if you were added to more than one company, removed from a company, etc. These represent old references to the official 'My Documents' object, which is always the first returned object (the one with the lowest ID value). 

 

Last updated: Dec 27, 2023