Authentication - Protect your API with Keys

Created by Danny Chu, Modified on Mon, 1 Aug, 2022 at 3:30 PM by Roanne Jane Jane Jaype

You can optionally protect your API using API Keys, to enable this functionality you can edit your Connection by clicking the "Edit" button on the top right corner of the connection details page:


Edit Connection



Then go to Advanced Settings and enable the API Key functionality


Protect Your API


You can then make requests using the X-Api-Key, like the examples by the side.


____________________


Shell

# Display data from the "Admin" tab
curl -H 'X-Api-Key: <Your API Key>' 'https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf'


Python

import requests

# Records
requests.get("https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf?_format=records")

# Dict
requests.get("https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf?_format=dict")

# List
requests.get("https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf?_format=list")

# Series
requests.get("https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf?_format=series")

# Split
requests.get("https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf?_format=split")

# Index
requests.get("https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf?_format=index")

Javascript

// Records
fetch(
  "https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf?_format=records"
);

// Dict
fetch(
  "https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf?_format=dict"
);

// List
fetch(
  "https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf?_format=list"
);

// Series
fetch(
  "https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf?_format=series"
);

// Split
fetch(
  "https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf?_format=split"
);

// Index
fetch(
  "https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf?_format=index"
);

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article