Submitting Metric Updates

The AchieveIt platform allows you to automate the process of publishing metric updates to plan items by submitting a CSV file containing the requested updates to our public REST API. For more information on the general aspects of the AchieveIt REST API, read our help article on API basics.

Metric Update Data File

Submit metric updates by POSTing the metric updates in a CSV (Comma Separate Values).

These are the attributes to include in CSV file for each metric update:

Field Name

Required

Comment

External ID

yes

External ID names cannot contain the phrase "external." It can contain spaces and special characters, with the exception of commas and quotation marks.

Current Metric Value

yes

Percentages should be formatted in decimal format – for example, 20% should be input as .2, rather than 20.

As Of Date

yes

This is the date for the metric update. The date can be formatted in any ISO-8601 compliant date format. Most of our customers use regular US date format – MM/DD/YYYY. AchieveIt only uses the date, so if you include a time in the As Of Date value, AchieveIt will ignore it.

 

A few additional items to note when building your CSV file:

  • You can choose to include or exclude column headers. If you choose to include them, the first column must be labeled External ID.
  • Columns must be in the same order as our template. From left to right, the columns should be External ID, Current Metric Value, and As Of Date.
  • The CSV file must not contain any empty rows.

A sample CSV file is attached to the end of this article.

Submitting Updates

Updates can be submitted by making an HTTP POST request to the following endpoint:

https://api.achieveit.com/api/metricupdates/<filename of CSV>

You must include the API key as part of an authorization header. The header needs to be in the following form:

Authorization: API-KEY <API_KEY>

Include your CSV in the body of the request.

For example (using cURL) - with a CSV title ‘my_updates.csv’ and an API key of ‘12004478285f4f4eb21cd25e62ba5eb7’, your request would look like the following:

curl -L -XPOST \

    -H 'Authorization: API-KEY 12004478285f4f4eb21cd25e62ba5eb7' \

    --data-binary "@my_updates.csv" \

    https://api.achieveit.com/api/metricupdates/my_updates.csv

The API responds with a Job ID and one of the following HTTP status codes:

  • 200 OK: Request has been successfully queued
  • 500 Internal Server Error: Request failed to be queued

Checking on Status of Data Processing

The API does not process update requests immediately or synchronously. It pushes each request to a queue and the system subsequently processes the updates. Except for the cases of invalid requests (authorization header is missing or is malformed, unexpected server error, etc.), your HTTP request should immediately return with a 200 OK response as well as a Job ID which you can use to query the status of your batch update request.

You can request the status of a batch update by making an HTTP GET request to the following endpoint:

https://api.achieveit.com/api/metricupdates/status/<UNIQUE_IDENTIFIER>

The system will respond with an HTTP status code indicating the state that your request is currently in:

  • 202 Accepted: Request is received or is currently being processed
  • 200 OK: Request has been successfully processed
  • 400 Bad Request: Request has failed to be processed
  • 500 Server Error: Request has failed to be processed

An example request using cURL with the same API key as before and a job ID of 2bf2dda7-2aa4-4345-b6a8-8070d6ceec39:

curl -LI -XGET \

    -H 'Authorization: API-KEY 12004478285f4f4eb21cd25e62ba5eb7' \

    https://api.achieveit.com/api/metricupdates/status/2bf2dda7-2aa4-4345-b6a8-8070d6ceec39

Additional Documentation

The API is also documented via Swagger, which can be accessed at the following URL:
https://api.achieveit.com/swagger/.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.