The Squarespace API allows developers to create, update, and view Squarespace content programmatically. Its expansive features make it possible to build a variety of applications, such as custom ecommerce stores, portfolios, and more. Here are just a few examples of what you can create with the Squarespace API.
By utilizing the Squarespace API, developers have the opportunity to build a wide range of applications that can be used in conjunction with the Squarespace platform. Whether it's an eCommerce store, a portfolio website, or custom APIs, the Squarespace developers have it all.
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`,
},
})
},
})
Squarespace uses OAuth authentication. When you connect your Squarespace account, Pipedream will open a popup window where you can sign into Squarespace and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Squarespace API.
Pipedream requests the following authorization scopes when you connect your account:
website.orders
website.orders.read
website.transactions.read
website.inventory
website.inventory.read
website.products
website.products.read
GET
https://login.squarespace.com/api/1/login/oauth/provider/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.comma_separated_scopes}}
&
access_type=offline
POST
https://login.squarespace.com/api/1/login/oauth/provider/tokens
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://login.squarespace.com/api/1/login/oauth/provider/tokens
content-type: application/x-www-form-urlencoded
accept: application/json
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}