How to Integrate With The MeasureSquare Cloud API

How to Integrate With The MeasureSquare Cloud API

In this article, you will learn how to correctly send your API requests to the MeasureSquare Cloud API.

This article applies to MeasureSquare Cloud.

Measure Square requires multiple parameters from third-party solution providers who wish to integrate with Measure Square's Cloud API. In addition a standard API key, the solution provider will need a secret key and will be required to provide three new parameters in every request.

Locate your API Key

If you already have an API key, you may locate it by accessing your MeasureSquare Cloud account and navigating to Group Management > Group Setting > API Key. If you do not already have an API key, please contact the Measure Square Support team at support@measuresquare.com or over the phone at (626) 683-9188.  

Use HTTP Basic Authentication protocol by doing the following:
  1. Base64-encode your API key
  2. Add the encoded API key to your HTTP request header named "Authorization": "Basic [your Base64-encoded API key here]" 

Receive your X-Application & Secret Key

Contact Measure Square at integration@measuresquare.com to receive both the X-Application and secret key for your application. 


Provide Required X-Headers

The three required parameters are listed below, along with descriptions. Please be aware that they should be provided in your HTTP request header.
  1. X-Application: String associated with your application
  2. X-Timestamp:  Current Unix timestamp
  3. X-Signature:     Unique signature generated by using both the secret key and timestamp string to generate a HMAC-SHA256 signature. This must be base 64-encoded.
Notes
Note: As best practice, the timestamp should always be current, because the Cloud API will reject requests with a timestamp older than five minutes.


Example

Below is an example of an API request containing the required X-headers written in C#:
  1. var client = new HttpClient();
  2. var request = new HttpRequestMessage(HttpMethod.Get, "https://cloud.measuresquare.com/api/projects/06113fe339134a068971329d11f943g28"); // Call Get Project API endpoint
  3. request.Headers.Add("X-Application", "SampleApplication");
  4. request.Headers.Add("X-Timestamp", "1751916708");
  5. request.Headers.Add("X-Signature", "GQe5g/P2KsAhDGLMM7FfyOCPzO1uaWBYfpGJcWyeWP8=");
  6. request.Headers.Add("Authorization", "Basic ZALjY3IyNzbxNeE0NDcwQmI1MzY2MGNPrTIxNmU7QXm=");
  7. var response = await client.SendAsync(request);
  8. response.EnsureSuccessStatusCode();
  9. Console.WriteLine(await response.Content.ReadAsStringAsync());

    • Related Articles

    • The MeasureSquare Cloud API Integration Reference

      In this article, you will learn the basics of integrating with MeasureSquare's Cloud API, as well as various integration workflows. MeasureSquare's Cloud API allows third-party applications to leverage MeasureSquare's project data, such as diagrams, ...
    • How do I integrate my third-party solution with MeasureSquare?

      This article is for any client who wishes to integrate or otherwise create an automated progress to transfer Measure Square project data into third-party systems such as Salesforce or Microsoft Dynamics 365. The MeasureSquare Cloud API has a variety ...
    • How do I access my API key?

      This article applies to the MeasureSquare Cloud. This article will show you how to access your API Key via the Cloud at cloud.measuresquare.com. If you do not already have a group set up in Measure Square Cloud, then to begin you must contact Measure ...
    • Commonly Used API Endpoints in MeasureSquare

      In this article, you will learn how which endpoints are commonly used and what they are used for When integrating Measure Square's Cloud API with your third-party system, you may be wondering where to start. To give you an idea of which endpoints you ...
    • Stripe Integration with MeasureSquare CRM

      In this article, we will cover an how to integrate with Stripe and how it's used in MeasureSquare CRM This article applies to MeasureSquare CRM version 1.38 and above. If you use Stripe to receive payments, and want to give customers an easy way to ...