Quickstart/Authentication
This guide will get you all set up and ready to use the Arguflow API. We'll cover how to get an authentication token and make your first API request with javascript. 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. Here's a link to our Postman collection.
Before you can make requests to the Vault API, you will need to grab your authentication cookie.
Create an account
- Go to the Vault client at https://vault.arguflow.ai and click the register button.
- Fill out the form and click the register button.
- Check your email for a confirmation link and click it.
- Set your password and click the confirm button.
You now have an account that you can use to authenticate with the Vault API.
Get your authentication token from the Vault API
import fetch from "node-fetch";
export const getAuthCookie = async () => {
const api_endpoint = process.env.API_ENDPOINT || "https://api.arguflow.ai/api";
const email = process.env.TEST_USER_EMAIL;
const password = process.env.TEST_USER_PASSWORD;
const response = await fetch(`${api_endpoint}/auth`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
credentials: "include",
body: JSON.stringify({ email, password }),
});
const cookies = response.headers.raw()["set-cookie"];
const authCookie = cookies.map((cookie) => cookie.split(";")[0]).join(";");
console.log(authCookie);
};
Include your authentication token in your future API requests as a cookie
const response = await fetch(`https://api.arguflow.ai/api/auth`, {
method: "GET",
headers: {
"Content-Type": "application/json",
Cookie: "cookie_from_previous_script",
},
});
console.log(response);
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 into the Vault API: