From 1115590ab27b3304141bf4f3c97eec7f081529d0 Mon Sep 17 00:00:00 2001 From: usbharu Date: Mon, 26 Aug 2024 13:34:20 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20http=E3=82=AF=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=82=A2=E3=83=B3=E3=83=88=E3=81=AE=E6=95=B4=E5=82=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit http-client.private.env.jsonを/api/v1/appsを実行した結果と以下の内容を合わせて作成することで使える { "dev": { "client_id": "", "client_secret": "", "host": "localhost:8081" } } --- http-client.env.json | 19 +++++++++++++++++++ mastodon-api.http | 14 ++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 http-client.env.json create mode 100644 mastodon-api.http diff --git a/http-client.env.json b/http-client.env.json new file mode 100644 index 00000000..c1b28a1f --- /dev/null +++ b/http-client.env.json @@ -0,0 +1,19 @@ +{ + "dev": { + "name": "value", + "Security": { + "Auth": { + "auth-id": { + "Type": "OAuth2", + "Grant Type": "Authorization Code", + "Client ID": "{{client_id}}", + "Client Secret": "{{client_secret}}", + "Redirect URL": "https://example.com", + "Token URL": "http://{{host}}/oauth/token", + "Auth URL": "http://{{host}}/oauth/authorize", + "Scope": "write read" + } + } + } + } +} \ No newline at end of file diff --git a/mastodon-api.http b/mastodon-api.http new file mode 100644 index 00000000..608850f0 --- /dev/null +++ b/mastodon-api.http @@ -0,0 +1,14 @@ +POST http://{{host}}/api/v1/apps +Accept: application/json +Content-Type: application/json + +{ + "client_name": "test-client", + "redirect_uris": "https://example.com", + "scopes": "write read" +} + +### + +GET http://{{host}}/api/v1/accounts/verify_credentials +Authorization: Bearer {{$auth.token("auth-id")}} \ No newline at end of file