Files
discogs-service/docs/data/documentation/discogsservice/client/postaccesstoken(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":[{"type":"text","text":"Provide required credentials data to obtain an access token."}],"identifier":{"url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/postAccessToken(headers:)","interfaceLanguage":"swift"},"sections":[],"kind":"symbol","metadata":{"modules":[{"name":"DiscogsService"}],"title":"postAccessToken(headers:)","role":"symbol","extendedModule":"DiscogsService","symbolKind":"method","roleHeading":"Instance Method","externalID":"s:14DiscogsService11APIProtocolPAAE15postAccessToken7headersAA10OperationsO04PosteF0O6OutputOAI5InputV7HeadersV_tYaKF::SYNTHESIZED::s:14DiscogsService6ClientV","fragments":[{"text":"func","kind":"keyword"},{"kind":"text","text":" "},{"text":"postAccessToken","kind":"identifier"},{"text":"(","kind":"text"},{"kind":"externalParam","text":"headers"},{"text":": ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"PostAccessToken","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO5InputV"},{"text":".","kind":"text"},{"kind":"typeIdentifier","text":"Headers","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO5InputV7HeadersV"},{"kind":"text","text":") "},{"kind":"keyword","text":"async"},{"kind":"text","text":" "},{"kind":"keyword","text":"throws"},{"kind":"text","text":" -> "},{"kind":"typeIdentifier","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"PostAccessToken","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Output","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO6OutputO"}]},"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"postAccessToken","kind":"identifier"},{"text":"(","kind":"text"},{"text":"headers","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"PostAccessToken","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO"},{"text":".","kind":"text"},{"text":"Input","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken\/Input","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO5InputV"},{"text":".","kind":"text"},{"text":"Headers","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken\/Input\/Headers-swift.struct","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO5InputV7HeadersV"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken","kind":"typeIdentifier","text":"PostAccessToken"},{"kind":"text","text":"."},{"text":"Output","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken\/Output","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO6OutputO"}],"platforms":["macOS"],"languages":["swift"]}]},{"content":[{"level":2,"text":"Discussion","type":"heading","anchor":"discussion"},{"type":"paragraph","inlineContent":[{"text":"Provide to the service some required credentials details to obtain an access token at the end of the ","type":"text"},{"type":"emphasis","inlineContent":[{"type":"text","text":"OAuth"}]},{"type":"text","text":" process."}]},{"inlineContent":[{"type":"text","text":"This endpoint represents the "},{"type":"reference","identifier":"https:\/\/www.discogs.com\/developers#header-4.-send-a-post-request-to-the-discogs-access-token-url","isActive":true},{"type":"text","text":", thus it requires to configure an "},{"type":"emphasis","inlineContent":[{"type":"text","text":"Authorization"}]},{"type":"text","text":" header to have a value like this:"}],"type":"paragraph"},{"code":["OAuth oauth_consumer_key=\"your_consumer_key\", oauth_nonce=\"random_string_or_timestamp\", oauth_token=\"oauth_token_received_from_step_2\" oauth_signature=\"your_consumer_secret&\", oauth_signature_method=\"PLAINTEXT\", oauth_timestamp=\"current_timestamp\", oauth_verifier=\"users_verifier\""],"type":"codeListing","syntax":null},{"type":"paragraph","inlineContent":[{"type":"text","text":"For further details about this process, please refer to the "},{"isActive":true,"type":"reference","identifier":"https:\/\/www.discogs.com\/developers#page:authentication,header:authentication-oauth-flow"},{"type":"text","text":" section in the "},{"isActive":true,"type":"reference","identifier":"https:\/\/www.discogs.com\/developers#page:authentication"},{"type":"text","text":" documentation."}]},{"type":"aside","name":"Remark","content":[{"inlineContent":[{"type":"text","text":"HTTP "},{"code":"POST \/oauth\/access_token","type":"codeVoice"},{"type":"text","text":"."}],"type":"paragraph"}],"style":"note"},{"type":"aside","name":"Remark","content":[{"inlineContent":[{"type":"text","text":"Generated from "},{"code":"#\/paths\/\/oauth\/access_token\/post(postAccessToken)","type":"codeVoice"},{"type":"text","text":"."}],"type":"paragraph"}],"style":"note"}],"kind":"content"}],"hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client"]]},"variants":[{"paths":["\/documentation\/discogsservice\/client\/postaccesstoken(headers:)"],"traits":[{"interfaceLanguage":"swift"}]}],"references":{"doc://DiscogsService/documentation/DiscogsService/Operations/PostAccessToken/Output":{"url":"\/documentation\/discogsservice\/operations\/postaccesstoken\/output","role":"symbol","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken\/Output","abstract":[],"fragments":[{"text":"enum","kind":"keyword"},{"kind":"text","text":" "},{"kind":"identifier","text":"Output"}],"kind":"symbol","title":"Operations.PostAccessToken.Output","type":"topic","navigatorTitle":[{"kind":"identifier","text":"Output"}]},"doc://DiscogsService/documentation/DiscogsService/Operations/PostAccessToken/Input":{"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken\/Input","title":"Operations.PostAccessToken.Input","url":"\/documentation\/discogsservice\/operations\/postaccesstoken\/input","kind":"symbol","type":"topic","navigatorTitle":[{"text":"Input","kind":"identifier"}],"abstract":[],"role":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Input","kind":"identifier"}]},"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"}]},"https://www.discogs.com/developers#page:authentication,header:authentication-oauth-flow":{"titleInlineContent":[{"type":"text","text":"OAuth flow"}],"url":"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","title":"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/Operations/PostAccessToken/Input/Headers-swift.struct":{"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken\/Input\/Headers-swift.struct","title":"Operations.PostAccessToken.Input.Headers","url":"\/documentation\/discogsservice\/operations\/postaccesstoken\/input\/headers-swift.struct","kind":"symbol","type":"topic","navigatorTitle":[{"text":"Headers","kind":"identifier"}],"abstract":[],"role":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Headers","kind":"identifier"}]},"doc://DiscogsService/documentation/DiscogsService/Client/postAccessToken(headers:)":{"title":"postAccessToken(headers:)","abstract":[{"text":"Provide required credentials data to obtain an access token.","type":"text"}],"role":"symbol","type":"topic","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"postAccessToken"},{"kind":"text","text":"("},{"kind":"externalParam","text":"headers"},{"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":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO5InputV"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Headers","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO5InputV7HeadersV"},{"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":"PostAccessToken","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Output","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO6OutputO"}],"kind":"symbol","url":"\/documentation\/discogsservice\/client\/postaccesstoken(headers:)","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/postAccessToken(headers:)"},"https://www.discogs.com/developers#page:authentication":{"titleInlineContent":[{"type":"text","text":"Discogs API authentication"}],"url":"https:\/\/www.discogs.com\/developers#page:authentication","type":"link","identifier":"https:\/\/www.discogs.com\/developers#page:authentication","title":"Discogs API authentication"},"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"},"https://www.discogs.com/developers#header-4.-send-a-post-request-to-the-discogs-access-token-url":{"titleInlineContent":[{"type":"text","text":"4th step of the OAuth flow process"}],"url":"https:\/\/www.discogs.com\/developers#header-4.-send-a-post-request-to-the-discogs-access-token-url","type":"link","identifier":"https:\/\/www.discogs.com\/developers#header-4.-send-a-post-request-to-the-discogs-access-token-url","title":"4th step of the OAuth flow process"},"doc://DiscogsService/documentation/DiscogsService/Operations/PostAccessToken":{"url":"\/documentation\/discogsservice\/operations\/postaccesstoken","role":"symbol","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken","abstract":[{"text":"Provide required credentials data to obtain an access token.","type":"text"}],"fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"PostAccessToken","kind":"identifier"}],"kind":"symbol","type":"topic","title":"Operations.PostAccessToken","navigatorTitle":[{"text":"PostAccessToken","kind":"identifier"}]}}}