API Client setup

This guide will get you all set up and ready to use the Uploadjoy API via a Typescript API client. We'll cover how to get started using the API client and how to make your first API request. We'll also look at where to go next to find all the information you need to take full advantage of our powerful REST API.

Get the client

Before making your first API request, you need to install the Uploadjoy client in your Node.js project. You can install the client using any package manager you wish.

npm install @uploadjoy/client --save

Making your first API request

After picking your preferred client, you are ready to make your first call to the Uploadjoy API. Below, you can see how to send a request to get a presigned URL to download a specific object.

POST
/v1/persigned-url
import { Uploadjoy } from "@uploadjoy/client";

export const ujClient = new Uploadjoy({
  apiToken: process.env.UPLOADJOY_API_TOKEN,
});

const keys = ["my-private-file.jpg"];
const response = await ujClient.presignedUrl.downloadPrivateObjects({
  keys,
  presignedUrlOptions: { expiresIn: 3600 },
});

console.log(response.data);

What's next?

Great, you're now set up with an API client and have made your first request to the API. Here are a few links that might be handy as you venture further: