ThomasT
BuildShip2y ago
7 replies
Thomas

OAuth 2.0 access

Hi I want to use the etsy api via Buildship and I am having troubles recreating a simple api key test in BuildShip:

https://developers.etsy.com/documentation/tutorials/quickstart

So they create a a valid OAuth 2.0 access token to make requests to any scoped endpoint. Is there any tutorial or resource on OAuth 2.0 access with BuildShip ?
This tutorial walks you through building a very simple Node.js application from start to finish. By the end, you will have a working application with a valid OAuth 2.0 access token to make requests to any scoped endpoint.
Solution
Hey @Thomas, to make an Etsy API Call via BuildShip, all you need to do is make a simple call to the Etsy API endpoint, like this:
export default async ({apiKey},{logging}) => {

const url = 'https://api.etsy.com/v3/application/openapi-ping';
const options = {
  method: 'GET',
  headers: {
    "x-api-key": apiKey
  }
};
  const resp = await fetch(url, options);
  const data = await resp.json();
  return data;
}

Here's a boilerplate node that you can copy and paste in your workflow. You can also use the "Modify Node with Al" feature to modify it according to your use case, learn more. Hope this helps :)
Was this page helpful?