From 15a4d30278c625f1e2c28cdb1b31d4db4921b775 Mon Sep 17 00:00:00 2001 From: laviniat1996 Date: Mon, 1 Dec 2025 05:36:30 +0200 Subject: [PATCH 1/2] add api v3 auth details page --- docs.json | 1 + ecosystem/api/toncenter/v3-authentication.mdx | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 ecosystem/api/toncenter/v3-authentication.mdx diff --git a/docs.json b/docs.json index 157573c33..8f67cd193 100644 --- a/docs.json +++ b/docs.json @@ -73,6 +73,7 @@ "expanded": true, "pages": [ "ecosystem/api/toncenter/get-api-key", + "ecosystem/api/toncenter/v3-authentication", { "group": "API v2", "openapi": { diff --git a/ecosystem/api/toncenter/v3-authentication.mdx b/ecosystem/api/toncenter/v3-authentication.mdx new file mode 100644 index 000000000..1d9eee0ee --- /dev/null +++ b/ecosystem/api/toncenter/v3-authentication.mdx @@ -0,0 +1,41 @@ +--- +title: "Authentication for API v3" +--- + +## Overview + +The API v3 requires an API key for all methods. +The key can be sent either in an HTTP header or as a query parameter. + +To obtain an API key, see the [TON Center API key guide](/ecosystem/api/toncenter/get-api-key). + +| Type | Location | Name | Required | +| ------- | -------- | ----------- | -------- | +| API key | Header | `X-API-Key` | Yes | +| API key | Query | `api_key` | Yes | + +Only one of these is needed per request. + + +## Header authentication + +Send the API key in the `X-API-Key` header: + +```bash +curl "https:///api/v3/masterchainInfo" \ + -H "X-API-Key: " +``` + +- `` - The base URL of the TON Center API instance (`toncenter.com` for example). +- `` - The API key obtained from the [TON Center bot](https://t.me/toncenter). + +## Query parameter authentication + +Pass the key as a query parameter named `api_key`: + +```bash +curl "https:///api/v3/masterchainInfo?api_key=" +``` + +Both forms are equivalent. + From bbe722f73930bb4a9597a795ba5271750598e4ea Mon Sep 17 00:00:00 2001 From: laviniat1996 Date: Mon, 1 Dec 2025 05:39:26 +0200 Subject: [PATCH 2/2] fix lintinbg --- ecosystem/api/toncenter/v3-authentication.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/ecosystem/api/toncenter/v3-authentication.mdx b/ecosystem/api/toncenter/v3-authentication.mdx index 1d9eee0ee..623f1d747 100644 --- a/ecosystem/api/toncenter/v3-authentication.mdx +++ b/ecosystem/api/toncenter/v3-authentication.mdx @@ -16,7 +16,6 @@ To obtain an API key, see the [TON Center API key guide](/ecosystem/api/toncente Only one of these is needed per request. - ## Header authentication Send the API key in the `X-API-Key` header: @@ -38,4 +37,3 @@ curl "https:///api/v3/masterchainInfo?api_key=" ``` Both forms are equivalent. -