Files
discogs-service/docs/data/documentation/discogsservice/client/getrequesttoken(_:).json
T
javier 9a30b69561 Implemented the Authentication endpoints (#9)
This PR contains the work done to implement the *Authentication* endpoints of the Discogs API:
* GET `/oauth/request_token`
* POST `/oauth/access_token`
* GET `/oauth/identity`

Reviewed-on: #9
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-10-13 17:55:48 +00:00

1 line
15 KiB
JSON

{"seeAlsoSections":[{"generated":true,"anchor":"Authentication-endpoints","title":"Authentication endpoints","identifiers":["doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/postAccessToken(_:)","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/getUserIdentity(_:)"]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"abstract":[{"type":"text","text":"Get details about a OAuth request token."}],"identifier":{"url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/getRequestToken(_:)","interfaceLanguage":"swift"},"sections":[],"kind":"symbol","metadata":{"modules":[{"name":"DiscogsService"}],"title":"getRequestToken(_:)","role":"symbol","symbolKind":"method","externalID":"s:14DiscogsService6ClientV15getRequestTokenyAA10OperationsO03GeteF0O6OutputOAH5InputVYaKF","roleHeading":"Instance Method","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getRequestToken","kind":"identifier"},{"text":"(","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"GetRequestToken","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO5InputV"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"GetRequestToken","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO"},{"text":".","kind":"text"},{"text":"Output","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO6OutputO"}]},"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getRequestToken","kind":"identifier"},{"text":"(","kind":"text"},{"text":"_","kind":"externalParam"},{"text":" ","kind":"text"},{"text":"input","kind":"internalParam"},{"text":": ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"GetRequestToken","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/GetRequestToken","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/GetRequestToken\/Input","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO5InputV"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"GetRequestToken","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/GetRequestToken","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO"},{"text":".","kind":"text"},{"text":"Output","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/GetRequestToken\/Output","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO6OutputO"}],"languages":["swift"],"platforms":["macOS"]}]},{"content":[{"anchor":"discussion","type":"heading","level":2,"text":"Discussion"},{"type":"paragraph","inlineContent":[{"text":"Retrieve a request token to initialize an ","type":"text"},{"inlineContent":[{"text":"OAuth","type":"text"}],"type":"emphasis"},{"text":" authentication process.","type":"text"}]},{"type":"paragraph","inlineContent":[{"text":"This endpoint represents the ","type":"text"},{"identifier":"https:\/\/www.discogs.com\/developers#header-2.-send-a-get-request-to-the-discogs-request-token-url","type":"reference","isActive":true},{"text":", thus it requires to configure an ","type":"text"},{"inlineContent":[{"text":"Authorization","type":"text"}],"type":"emphasis"},{"text":" header to have a value like this:","type":"text"}]},{"syntax":null,"code":["OAuth oauth_consumer_key=\"your_consumer_key\", oauth_nonce=\"random_string_or_timestamp\", oauth_signature=\"your_consumer_secret&\", oauth_signature_method=\"PLAINTEXT\", oauth_timestamp=\"current_timestamp\", oauth_callback=\"your_callback\""],"type":"codeListing"},{"type":"paragraph","inlineContent":[{"text":"For further details about this process, please refer to the ","type":"text"},{"identifier":"https:\/\/www.discogs.com\/developers#page:authentication,header:authentication-oauth-flow","type":"reference","isActive":true},{"text":" section in the ","type":"text"},{"identifier":"https:\/\/www.discogs.com\/developers#page:authentication","type":"reference","isActive":true},{"text":" documentation.","type":"text"}]},{"content":[{"inlineContent":[{"text":"HTTP ","type":"text"},{"type":"codeVoice","code":"GET \/oauth\/request_token"},{"text":".","type":"text"}],"type":"paragraph"}],"name":"Remark","type":"aside","style":"note"},{"content":[{"inlineContent":[{"text":"Generated from ","type":"text"},{"type":"codeVoice","code":"#\/paths\/\/oauth\/request_token\/get(getRequestToken)"},{"text":".","type":"text"}],"type":"paragraph"}],"name":"Remark","type":"aside","style":"note"}],"kind":"content"}],"hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client"]]},"variants":[{"paths":["\/documentation\/discogsservice\/client\/getrequesttoken(_:)"],"traits":[{"interfaceLanguage":"swift"}]}],"references":{"https://www.discogs.com/developers#page:authentication":{"type":"link","identifier":"https:\/\/www.discogs.com\/developers#page:authentication","titleInlineContent":[{"type":"text","text":"Discogs API authentication"}],"title":"Discogs API authentication","url":"https:\/\/www.discogs.com\/developers#page:authentication"},"doc://DiscogsService/documentation/DiscogsService/Client/getRequestToken(_:)":{"abstract":[{"type":"text","text":"Get details about a OAuth request token."}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/getRequestToken(_:)","url":"\/documentation\/discogsservice\/client\/getrequesttoken(_:)","title":"getRequestToken(_:)","role":"symbol","type":"topic","kind":"symbol","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getRequestToken","kind":"identifier"},{"text":"(","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"GetRequestToken","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO5InputV","kind":"typeIdentifier"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"GetRequestToken","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Output","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO6OutputO","kind":"typeIdentifier"}]},"doc://DiscogsService/documentation/DiscogsService/Operations":{"url":"\/documentation\/discogsservice\/operations","kind":"symbol","role":"symbol","type":"topic","fragments":[{"kind":"keyword","text":"enum"},{"text":" ","kind":"text"},{"kind":"identifier","text":"Operations"}],"abstract":[{"type":"text","text":"API operations, with input and output types, generated from "},{"type":"codeVoice","code":"#\/paths"},{"text":" in the OpenAPI document.","type":"text"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","navigatorTitle":[{"kind":"identifier","text":"Operations"}],"title":"Operations"},"doc://DiscogsService/documentation/DiscogsService/Client/postAccessToken(_:)":{"abstract":[{"type":"text","text":"Provide required credentials data to obtain an access token."}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/postAccessToken(_:)","url":"\/documentation\/discogsservice\/client\/postaccesstoken(_:)","title":"postAccessToken(_:)","role":"symbol","type":"topic","kind":"symbol","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"identifier","text":"postAccessToken"},{"text":"(","kind":"text"},{"kind":"typeIdentifier","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"PostAccessToken","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO5InputV"},{"kind":"text","text":") "},{"kind":"keyword","text":"async"},{"kind":"text","text":" "},{"text":"throws","kind":"keyword"},{"kind":"text","text":" -> "},{"kind":"typeIdentifier","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"PostAccessToken","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Output","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO6OutputO"}]},"doc://DiscogsService/documentation/DiscogsService/Client/getUserIdentity(_:)":{"abstract":[{"type":"text","text":"Get information about an authenticated user."}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/getUserIdentity(_:)","url":"\/documentation\/discogsservice\/client\/getuseridentity(_:)","title":"getUserIdentity(_:)","role":"symbol","type":"topic","kind":"symbol","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getUserIdentity","kind":"identifier"},{"text":"(","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"GetUserIdentity","preciseIdentifier":"s:14DiscogsService10OperationsO15GetUserIdentityO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO15GetUserIdentityO5InputV","kind":"typeIdentifier"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"GetUserIdentity","preciseIdentifier":"s:14DiscogsService10OperationsO15GetUserIdentityO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Output","preciseIdentifier":"s:14DiscogsService10OperationsO15GetUserIdentityO6OutputO","kind":"typeIdentifier"}]},"doc://DiscogsService/documentation/DiscogsService/Client":{"url":"\/documentation\/discogsservice\/client","role":"symbol","abstract":[{"type":"text","text":"The Discogs API v2.0 is a RESTful interface to Discogs data. You can access JSON-formatted information about Database objects such as "},{"inlineContent":[{"type":"text","text":"Artists"}],"type":"emphasis"},{"type":"text","text":", "},{"inlineContent":[{"type":"text","text":"Releases"}],"type":"emphasis"},{"type":"text","text":", and "},{"inlineContent":[{"type":"text","text":"Labels"}],"type":"emphasis"},{"type":"text","text":". Your application can also manage "},{"inlineContent":[{"type":"text","text":"User Collections"}],"type":"emphasis"},{"type":"text","text":" and "},{"inlineContent":[{"type":"text","text":"Wantlists"}],"type":"emphasis"},{"type":"text","text":", create "},{"inlineContent":[{"type":"text","text":"Marketplace"}],"type":"emphasis"},{"type":"text","text":" listings, and more."}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Client","kind":"identifier"}],"kind":"symbol","type":"topic","title":"Client","navigatorTitle":[{"text":"Client","kind":"identifier"}]},"doc://DiscogsService/documentation/DiscogsService/Operations/GetRequestToken":{"url":"\/documentation\/discogsservice\/operations\/getrequesttoken","kind":"symbol","role":"symbol","type":"topic","fragments":[{"kind":"keyword","text":"enum"},{"kind":"text","text":" "},{"kind":"identifier","text":"GetRequestToken"}],"abstract":[{"text":"Get details about a OAuth request token.","type":"text"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/GetRequestToken","navigatorTitle":[{"kind":"identifier","text":"GetRequestToken"}],"title":"Operations.GetRequestToken"},"doc://DiscogsService/documentation/DiscogsService/Operations/GetRequestToken/Output":{"url":"\/documentation\/discogsservice\/operations\/getrequesttoken\/output","kind":"symbol","role":"symbol","type":"topic","fragments":[{"kind":"keyword","text":"enum"},{"text":" ","kind":"text"},{"text":"Output","kind":"identifier"}],"abstract":[],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/GetRequestToken\/Output","navigatorTitle":[{"text":"Output","kind":"identifier"}],"title":"Operations.GetRequestToken.Output"},"https://www.discogs.com/developers#header-2.-send-a-get-request-to-the-discogs-request-token-url":{"type":"link","identifier":"https:\/\/www.discogs.com\/developers#header-2.-send-a-get-request-to-the-discogs-request-token-url","titleInlineContent":[{"type":"text","text":"2nd step of the OAuth flow process"}],"title":"2nd step of the OAuth flow process","url":"https:\/\/www.discogs.com\/developers#header-2.-send-a-get-request-to-the-discogs-request-token-url"},"doc://DiscogsService/documentation/DiscogsService":{"title":"DiscogsService","abstract":[],"role":"collection","type":"topic","kind":"symbol","url":"\/documentation\/discogsservice","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService"},"https://www.discogs.com/developers#page:authentication,header:authentication-oauth-flow":{"type":"link","identifier":"https:\/\/www.discogs.com\/developers#page:authentication,header:authentication-oauth-flow","titleInlineContent":[{"type":"text","text":"OAuth flow"}],"title":"OAuth flow","url":"https:\/\/www.discogs.com\/developers#page:authentication,header:authentication-oauth-flow"},"doc://DiscogsService/documentation/DiscogsService/Operations/GetRequestToken/Input":{"url":"\/documentation\/discogsservice\/operations\/getrequesttoken\/input","kind":"symbol","role":"symbol","type":"topic","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Input","kind":"identifier"}],"abstract":[],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/GetRequestToken\/Input","navigatorTitle":[{"text":"Input","kind":"identifier"}],"title":"Operations.GetRequestToken.Input"}}}