From 1d51bc6814135ddd4943d226ac77ae6ff345d524 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 26 Apr 2025 04:27:13 +0000 Subject: [PATCH] Update token scopes example (#215) Reviewed-on: https://gitea.com/gitea/docs/pulls/215 Reviewed-by: techknowlogick Co-authored-by: Lunny Xiao Co-committed-by: Lunny Xiao --- versioned_docs/version-1.23/development/api-usage.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/versioned_docs/version-1.23/development/api-usage.md b/versioned_docs/version-1.23/development/api-usage.md index 48c82380..e00a52e6 100644 --- a/versioned_docs/version-1.23/development/api-usage.md +++ b/versioned_docs/version-1.23/development/api-usage.md @@ -35,7 +35,8 @@ Note that `/users/:name/tokens` is a special endpoint and requires you to authenticate using `BasicAuth` and a password, as follows: ```sh -$ curl -H "Content-Type: application/json" -d '{"name":"test"}' -u username:password https://gitea.your.host/api/v1/users//tokens +$ curl -H "Content-Type: application/json" -d '{"name":test_token","scopes":["read:activitypub","read:issue", "write:misc", "read:notification", "read:organization", "read:package", "read:repository", "read:user"]}' +-u 'username:password' "https://gitea.your.host/api/v1/users/{username}/tokens" {"id":1,"name":"test","sha1":"9fcb1158165773dd010fca5f0cf7174316c3e37d","token_last_eight":"16c3e37d"} ```