Files
discogs-service/docs/data/documentation/discogsservice/client/getrequesttoken(headers:).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
14 KiB
JSON

{"schemaVersion":{"major":0,"minor":3,"patch":0},"abstract":[{"text":"Get details about a OAuth request token.","type":"text"}],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/getRequestToken(headers:)"},"sections":[],"kind":"symbol","metadata":{"modules":[{"name":"DiscogsService"}],"extendedModule":"DiscogsService","role":"symbol","title":"getRequestToken(headers:)","symbolKind":"method","roleHeading":"Instance Method","externalID":"s:14DiscogsService11APIProtocolPAAE15getRequestToken7headersAA10OperationsO03GeteF0O6OutputOAI5InputV7HeadersV_tYaKF::SYNTHESIZED::s:14DiscogsService6ClientV","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getRequestToken","kind":"identifier"},{"text":"(","kind":"text"},{"text":"headers","kind":"externalParam"},{"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":"Headers","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO5InputV7HeadersV"},{"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":[{"platforms":["macOS"],"languages":["swift"],"tokens":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"getRequestToken"},{"kind":"text","text":"("},{"kind":"externalParam","text":"headers"},{"kind":"text","text":": "},{"preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier","text":"Operations","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations"},{"kind":"text","text":"."},{"preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO","kind":"typeIdentifier","text":"GetRequestToken","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/GetRequestToken"},{"kind":"text","text":"."},{"preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO5InputV","kind":"typeIdentifier","text":"Input","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/GetRequestToken\/Input"},{"kind":"text","text":"."},{"preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO5InputV7HeadersV","kind":"typeIdentifier","text":"Headers","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/GetRequestToken\/Input\/Headers-swift.struct"},{"kind":"text","text":") "},{"kind":"keyword","text":"async"},{"kind":"text","text":" "},{"kind":"keyword","text":"throws"},{"kind":"text","text":" -> "},{"preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier","text":"Operations","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations"},{"kind":"text","text":"."},{"preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO","kind":"typeIdentifier","text":"GetRequestToken","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/GetRequestToken"},{"kind":"text","text":"."},{"preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO6OutputO","kind":"typeIdentifier","text":"Output","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/GetRequestToken\/Output"}]}]},{"content":[{"text":"Discussion","level":2,"anchor":"discussion","type":"heading"},{"inlineContent":[{"type":"text","text":"Retrieve a request token to initialize an "},{"inlineContent":[{"text":"OAuth","type":"text"}],"type":"emphasis"},{"type":"text","text":" authentication process."}],"type":"paragraph"},{"inlineContent":[{"type":"text","text":"This endpoint represents the "},{"type":"reference","identifier":"https:\/\/www.discogs.com\/developers#header-2.-send-a-get-request-to-the-discogs-request-token-url","isActive":true},{"type":"text","text":", thus it requires to configure an "},{"inlineContent":[{"text":"Authorization","type":"text"}],"type":"emphasis"},{"type":"text","text":" header to have a value like this:"}],"type":"paragraph"},{"syntax":null,"type":"codeListing","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\""]},{"inlineContent":[{"type":"text","text":"For further details about this process, please refer to the "},{"type":"reference","identifier":"https:\/\/www.discogs.com\/developers#page:authentication,header:authentication-oauth-flow","isActive":true},{"type":"text","text":" section in the "},{"type":"reference","identifier":"https:\/\/www.discogs.com\/developers#page:authentication","isActive":true},{"type":"text","text":" documentation."}],"type":"paragraph"},{"type":"aside","name":"Remark","style":"note","content":[{"inlineContent":[{"text":"HTTP ","type":"text"},{"code":"GET \/oauth\/request_token","type":"codeVoice"},{"text":".","type":"text"}],"type":"paragraph"}]},{"type":"aside","name":"Remark","style":"note","content":[{"inlineContent":[{"text":"Generated from ","type":"text"},{"code":"#\/paths\/\/oauth\/request_token\/get(getRequestToken)","type":"codeVoice"},{"text":".","type":"text"}],"type":"paragraph"}]}],"kind":"content"}],"hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client"]]},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/discogsservice\/client\/getrequesttoken(headers:)"]}],"references":{"https://www.discogs.com/developers#header-2.-send-a-get-request-to-the-discogs-request-token-url":{"url":"https:\/\/www.discogs.com\/developers#header-2.-send-a-get-request-to-the-discogs-request-token-url","titleInlineContent":[{"text":"2nd step of the OAuth flow process","type":"text"}],"title":"2nd step of the OAuth flow process","type":"link","identifier":"https:\/\/www.discogs.com\/developers#header-2.-send-a-get-request-to-the-discogs-request-token-url"},"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/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"},"doc://DiscogsService/documentation/DiscogsService/Operations/GetRequestToken/Input/Headers-swift.struct":{"type":"topic","url":"\/documentation\/discogsservice\/operations\/getrequesttoken\/input\/headers-swift.struct","kind":"symbol","title":"Operations.GetRequestToken.Input.Headers","abstract":[],"role":"symbol","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/GetRequestToken\/Input\/Headers-swift.struct","navigatorTitle":[{"text":"Headers","kind":"identifier"}],"fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Headers","kind":"identifier"}]},"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/getRequestToken(headers:)":{"title":"getRequestToken(headers:)","abstract":[{"text":"Get details about a OAuth request token.","type":"text"}],"role":"symbol","type":"topic","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"getRequestToken"},{"kind":"text","text":"("},{"kind":"externalParam","text":"headers"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"GetRequestToken","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO5InputV"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Headers","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO5InputV7HeadersV"},{"kind":"text","text":") "},{"kind":"keyword","text":"async"},{"kind":"text","text":" "},{"kind":"keyword","text":"throws"},{"kind":"text","text":" -> "},{"kind":"typeIdentifier","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"GetRequestToken","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Output","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO6OutputO"}],"kind":"symbol","url":"\/documentation\/discogsservice\/client\/getrequesttoken(headers:)","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/getRequestToken(headers:)"},"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#page:authentication":{"url":"https:\/\/www.discogs.com\/developers#page:authentication","titleInlineContent":[{"text":"Discogs API authentication","type":"text"}],"title":"Discogs API authentication","type":"link","identifier":"https:\/\/www.discogs.com\/developers#page:authentication"},"https://www.discogs.com/developers#page:authentication,header:authentication-oauth-flow":{"url":"https:\/\/www.discogs.com\/developers#page:authentication,header:authentication-oauth-flow","titleInlineContent":[{"text":"OAuth flow","type":"text"}],"title":"OAuth flow","type":"link","identifier":"https:\/\/www.discogs.com\/developers#page:authentication,header:authentication-oauth-flow"},"doc://DiscogsService/documentation/DiscogsService":{"title":"DiscogsService","abstract":[],"role":"collection","type":"topic","kind":"symbol","url":"\/documentation\/discogsservice","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService"},"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"}]}}}