From 908a27589d50f7e65037c2af61ffd019d8582f20 Mon Sep 17 00:00:00 2001 From: desysoft Date: Wed, 3 Sep 2025 21:00:09 +0000 Subject: [PATCH] Update versioned_docs/version-1.24/development/api-usage.md (#269) Fix JSON syntax error in token creation request The previous JSON was malformed: {"name":test_token","scopes":[...]} The value of "name" was missing opening quotes, causing the error: invalid character 't' looking for beginning of value Fixed by enclosing the string in double quotes: {"name":"test_token","scopes":[...]} Reviewed-on: https://gitea.com/gitea/docs/pulls/269 Reviewed-by: techknowlogick Co-authored-by: desysoft Co-committed-by: desysoft --- versioned_docs/version-1.24/development/api-usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioned_docs/version-1.24/development/api-usage.md b/versioned_docs/version-1.24/development/api-usage.md index 544f1914..c870e91d 100644 --- a/versioned_docs/version-1.24/development/api-usage.md +++ b/versioned_docs/version-1.24/development/api-usage.md @@ -35,7 +35,7 @@ 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_token","scopes":["read:activitypub","read:issue", "write:misc", "read:notification", "read:organization", "read:package", "read:repository", "read:user"]}' +$ 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_token","sha1":"9fcb1158165773dd010fca5f0cf7174316c3e37d","token_last_eight":"16c3e37d"} ```