with Squarespace and Unleashed Software?
Squarespace's API provides a means to interface programmatically with your Squarespace site, allowing for a plethora of automation opportunities such as manipulating inventory, modifying site content, and syncing data with third-party services. When combined with Pipedream, this can translate into powerful workflows that streamline operations, enhance customer engagement, and keep various platforms in sync with your Squarespace data in real-time.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
squarespace: {
type: "app",
app: "squarespace",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.squarespace.com/1.0/authorization/website`,
headers: {
Authorization: `Bearer ${this.squarespace.$auth.oauth_access_token}`,
"accept": `application/json`,
},
})
},
})
import { axios } from "@pipedream/platform";
import crypto from "crypto";
export default defineComponent({
props: {
unleashed_software: {
type: "app",
app: "unleashed_software",
}
},
async run({ steps, $ }) {
const baseUrl = "https://api.unleashedsoftware.com";
const resource = "Accounts";
// The queryString is used in calculating signature, add your query string parameters
// e.g. for the Customers resource customerCode=FRANCK&includeObsolete=true
// or just pass an empty string
const queryString = "";
const uri = `${baseUrl}/${resource}${queryString ? `?${queryString}` : ""}`
// Generate HMAC-SHA256 signature
const signature = crypto
.createHmac("sha256", this.unleashed_software.$auth.api_key)
.update(queryString)
.digest("base64")
// Make the request
return await axios($, {
method: "GET",
url: uri,
headers: {
"api-auth-id": this.unleashed_software.$auth.api_id,
"api-auth-signature": signature,
"Accept": "application/json",
"Content-Type": "application/json; charset=utf-8",
},
});
},
})