What is an API

API stands for application programming interface, and it’s a system that lets different applications talk to each other easily.

A great analogy is an electrical socket. Many different sources can provide power to the light socket in your home. It can be from solar, wind, or even nuclear, but they all connect to your light socket. And on the other end are what you connect. It could be your cell phone, power drill, or TV, but they all receive the electricity from that wall socket.

An API is like that system; as long as the standard is set, any application can communicate. Like in the electricity example, if the kind of electrical current is being sent and the outlet’s size and shape are standardized, it all works out nicely. The power plants know what to send out, and the devices know how to connect and receive power.

Shopmonkey uses REST APIs to connect to your applications. When connecting to the Shopmonkey API, your application can access Customers, Orders, Users, Vehicles, and Inventory.

Note: To update information using Shopmonkey API, the data must have been created using the API. Data created in the UI can not be changed using the API.

If this was new to you, you might want to check out our article on Webhooks to learn more about how Shopmonkey connects to other applications. Webhooks can send information in real-time, so when an appointment is created in Shopmonkey, it can tell your calendar system to create a new event. An API can be used for periodic updates or to transfer a lot of information from Shopmonkey to another application. If you wanted to update your CRM with new customer data each morning, or if you wanted all of your orders uploaded into a BI tool, the API can help with that.

Using an API requires skills. Writing code, computer science knowledge, and development experience are a minimum when using an API. If you knew this already, continue for more information on how to connect to Shopmonkey API.


API Keys

You can connect to Shopmonkey using a Public and Private API Key. Contact our support team to have the API Keys turned on. After they are on, you can find your API Keys by clicking on your name in the top right corner and then Update Personal Info. From there, you’ll see the Public and Private Key under your contact information.


API Documentation

For those experienced with APIs, Shopmonkey has documentation detailing important information necessary in using the API.

Sending Headers in the API Request

For authorization of each request to the API, you need to send 3 headers:

publickey: "..."

signature: "..."

xdate: "..."

To generate the signature, you'll need to hash a combination of the date, the public key, and a private key. currentDate should return Unix time in milliseconds. The following is the code example in JavaScript:

const unixTimestamp = Date.now();
const publicKey = "YOUR PUBLIC KEY";
const privateKey = "YOUR PRIVATE KEY";
const hash = CryptoJS.HmacSHA256([publicKey,unixTimestamp].join('\n'), privateKey);
const signature = CryptoJS.enc.Base64.stringify(hash);

Additional Resources

For more information on accessible data from Shopmonkey consult the resource below.

https://developer.shopmonkey.io/

Did this answer your question?