Files
plex-docs/docs/plex-tv/get-pin.api.mdx
Luke Hagar 9e0c39c66b dev changes
2023-04-20 07:50:46 -05:00

37 lines
14 KiB
Plaintext

---
id: get-pin
sidebar_label: Get a Pin
hide_title: true
hide_table_of_contents: true
api: {"tags":["Plex.tv"],"operationId":"getPin","description":"Retrieve a Pin from Plex.tv for authentication flows","security":[{"ClientIdentifier":[]}],"parameters":[{"name":"strong","description":"Determines the kind of code returned by the API call\nStrong codes are used for Pin authentication flows\nNon-Strong codes are used for `Plex.tv/link`\n","in":"query","schema":{"type":"boolean","default":false},"required":false}],"responses":{"200":{"description":"The Pin","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"PinID for use with authentication","type":"number","example":1272322473},"code":{"type":"string","example":"3patfx1a78ukcbr7x0n9bl26t"},"product":{"type":"string","example":"Plex Web"},"trusted":{"type":"boolean"},"qr":{"description":"a link to a QR code hosted on plex.tv \nThe QR code redirects to the relevant `plex.tv/link` authentication page\nWhich then prompts the user for the 4 Digit Link Pin\n","type":"string","example":"https://plex.tv/api/v2/pins/qr/3patfx1a78ukcbr7x0n9bl26t"},"clientIdentifier":{"type":"string","example":"Postman"},"location":{"type":"object","properties":{"code":{"type":"string","example":"US"},"european_union_member":{"type":"boolean"},"continent_code":{"type":"string","example":"NA"},"country":{"type":"string","example":"United States"},"city":{"type":"string","example":"Austin"},"time_zone":{"type":"string","example":"America/Chicago"},"postal_code":{"type":"string","example":78732},"in_privacy_restricted_country":{"type":"boolean"},"subdivisions":{"type":"string","example":"Texas"},"coordinates":{"type":"string","example":"30.3768 -97.8935"}}},"expiresIn":{"type":"number","example":1800},"createdAt":{"type":"string","format":"date-time","example":"2023-04-12T17:00:03.000Z"},"expiresAt":{"type":"string","format":"date-time","example":"2023-04-12T17:30:03.000Z"},"authToken":{"type":"string","format":"nullable"},"newRegistration":{"type":"string","format":"nullable"}}}}}},"400":{"description":"X-Plex-Client-Identifier is missing","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number","example":1000},"message":{"type":"string","example":"X-Plex-Client-Identifier is missing"},"status":{"type":"number","example":400}}}}}}}}}},"method":"post","path":"/pins","servers":[{"url":"https://plex.tv/api/v2"}],"securitySchemes":{"Token":{"description":"Plex Authentication Token","type":"apiKey","in":"header","name":"X-Plex-Token"},"ClientIdentifier":{"description":"Plex Authentication Token","type":"apiKey","in":"header","name":"X-Plex-Client-Identifier"},"DeviceName":{"description":"Primary name for the device eg. `Plex Web (Chrome)`","type":"apiKey","in":"header","name":"X-Plex-Device-Name"},"Device":{"description":"The type of device your application is running on\nDevice name and or model number, eg `iPhone3,2`, `Motorola XOOM™`, `LG5200TV`\n","type":"apiKey","in":"header","name":"X-Plex-Device"},"PlatformVersion":{"description":"Operating system version\neg `4.3.1`, `10.6.7`, `3.2`\n","type":"apiKey","in":"header","name":"X-Plex-Platform-Version"},"Platform":{"description":"Platform name \neg: `Web`, `iOS`, `MacOSX`, `Android`, `LG`\n","type":"apiKey","in":"header","name":"X-Plex-Platform"},"Product":{"description":"Plex application name \neg: `Laika`, `Plex Media Server`, `Media Link`\n","type":"apiKey","in":"header","name":"X-Plex-Product"},"Version":{"description":"Plex application version number","type":"apiKey","in":"header","name":"X-Plex-Version"}},"info":{"title":"Plex-API","summary":"A Plex.TV API Map","description":"An Open API Spec for interacting with Plex.tv","version":"0.0.3","contact":{"name":"Luke Hagar","url":"https://www.LukeHagar.com","email":"Lukeslakemail@gmail.com"},"license":{"name":"MIT","identifier":"MIT","url":"https://opensource.org/licenses/MIT"}},"postman":{"name":"Get a Pin","description":{"content":"Retrieve a Pin from Plex.tv for authentication flows","type":"text/plain"},"url":{"path":["pins"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"Determines the kind of code returned by the API call\nStrong codes are used for Pin authentication flows\nNon-Strong codes are used for `Plex.tv/link`\n","type":"text/plain"},"key":"strong","value":""}],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"POST","auth":{"type":"apikey","apikey":[{"type":"any","value":"X-Plex-Client-Identifier","key":"key"},{"type":"any","value":"<API Key>","key":"value"},{"type":"any","value":"header","key":"in"}]}}}
sidebar_class_name: "post api-method"
info_path: docs/plex-tv/plex-api
---
import ApiTabs from "@theme/ApiTabs";
import DiscriminatorTabs from "@theme/DiscriminatorTabs";
import MethodEndpoint from "@theme/ApiDemoPanel/MethodEndpoint";
import MimeTabs from "@theme/MimeTabs";
import ParamsItem from "@theme/ParamsItem";
import ResponseSamples from "@theme/ResponseSamples";
import SchemaItem from "@theme/SchemaItem";
import SchemaTabs from "@theme/SchemaTabs";
import TabItem from "@theme/TabItem";
<h1 className={"openapi__heading"}>Get a Pin</h1>
<MethodEndpoint method={"post"} path={"/pins"}></MethodEndpoint>
Retrieve a Pin from Plex.tv for authentication flows
<details style={{"marginBottom":"1rem"}} className={"openapi-markdown__details"} data-collapsed={false} open={true}><summary style={{}}><strong>Query Parameters</strong></summary><div><ul><ParamsItem className={"paramsItem"} param={{"name":"strong","description":"Determines the kind of code returned by the API call\nStrong codes are used for Pin authentication flows\nNon-Strong codes are used for `Plex.tv/link`\n","in":"query","schema":{"type":"boolean","default":false},"required":false}}></ParamsItem></ul></div></details><div><div><ApiTabs><TabItem label={"200"} value={"200"}><div>
The Pin
</div><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details"} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaName={"number"} qualifierMessage={undefined} schema={{"description":"PinID for use with authentication","type":"number","example":1272322473}}></SchemaItem><SchemaItem collapsible={false} name={"code"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"3patfx1a78ukcbr7x0n9bl26t"}}></SchemaItem><SchemaItem collapsible={false} name={"product"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"Plex Web"}}></SchemaItem><SchemaItem collapsible={false} name={"trusted"} required={false} schemaName={"boolean"} qualifierMessage={undefined} schema={{"type":"boolean"}}></SchemaItem><SchemaItem collapsible={false} name={"qr"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"a link to a QR code hosted on plex.tv \nThe QR code redirects to the relevant `plex.tv/link` authentication page\nWhich then prompts the user for the 4 Digit Link Pin\n","type":"string","example":"https://plex.tv/api/v2/pins/qr/3patfx1a78ukcbr7x0n9bl26t"}}></SchemaItem><SchemaItem collapsible={false} name={"clientIdentifier"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"Postman"}}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}} className={"openapi-markdown__details"}><summary style={{}}><strong>location</strong><span style={{"opacity":"0.6"}}> object</span></summary><div style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"code"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"US"}}></SchemaItem><SchemaItem collapsible={false} name={"european_union_member"} required={false} schemaName={"boolean"} qualifierMessage={undefined} schema={{"type":"boolean"}}></SchemaItem><SchemaItem collapsible={false} name={"continent_code"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"NA"}}></SchemaItem><SchemaItem collapsible={false} name={"country"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"United States"}}></SchemaItem><SchemaItem collapsible={false} name={"city"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"Austin"}}></SchemaItem><SchemaItem collapsible={false} name={"time_zone"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"America/Chicago"}}></SchemaItem><SchemaItem collapsible={false} name={"postal_code"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":78732}}></SchemaItem><SchemaItem collapsible={false} name={"in_privacy_restricted_country"} required={false} schemaName={"boolean"} qualifierMessage={undefined} schema={{"type":"boolean"}}></SchemaItem><SchemaItem collapsible={false} name={"subdivisions"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"Texas"}}></SchemaItem><SchemaItem collapsible={false} name={"coordinates"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"30.3768 -97.8935"}}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={false} name={"expiresIn"} required={false} schemaName={"number"} qualifierMessage={undefined} schema={{"type":"number","example":1800}}></SchemaItem><SchemaItem collapsible={false} name={"createdAt"} required={false} schemaName={"date-time"} qualifierMessage={undefined} schema={{"type":"string","format":"date-time","example":"2023-04-12T17:00:03.000Z"}}></SchemaItem><SchemaItem collapsible={false} name={"expiresAt"} required={false} schemaName={"date-time"} qualifierMessage={undefined} schema={{"type":"string","format":"date-time","example":"2023-04-12T17:30:03.000Z"}}></SchemaItem><SchemaItem collapsible={false} name={"authToken"} required={false} schemaName={"nullable"} qualifierMessage={undefined} schema={{"type":"string","format":"nullable"}}></SchemaItem><SchemaItem collapsible={false} name={"newRegistration"} required={false} schemaName={"nullable"} qualifierMessage={undefined} schema={{"type":"string","format":"nullable"}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"id\": 1272322473,\n \"code\": \"3patfx1a78ukcbr7x0n9bl26t\",\n \"product\": \"Plex Web\",\n \"trusted\": true,\n \"qr\": \"https://plex.tv/api/v2/pins/qr/3patfx1a78ukcbr7x0n9bl26t\",\n \"clientIdentifier\": \"Postman\",\n \"location\": {\n \"code\": \"US\",\n \"european_union_member\": true,\n \"continent_code\": \"NA\",\n \"country\": \"United States\",\n \"city\": \"Austin\",\n \"time_zone\": \"America/Chicago\",\n \"postal_code\": 78732,\n \"in_privacy_restricted_country\": true,\n \"subdivisions\": \"Texas\",\n \"coordinates\": \"30.3768 -97.8935\"\n },\n \"expiresIn\": 1800,\n \"createdAt\": \"2023-04-12T17:00:03.000Z\",\n \"expiresAt\": \"2023-04-12T17:30:03.000Z\",\n \"authToken\": \"string\",\n \"newRegistration\": \"string\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"400"} value={"400"}><div>
X-Plex-Client-Identifier is missing
</div><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details"} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}} className={"openapi-markdown__details"}><summary style={{}}><strong>errors</strong><span style={{"opacity":"0.6"}}> object[]</span></summary><div style={{"marginLeft":"1rem"}}><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}>Array [</div></li><SchemaItem collapsible={false} name={"code"} required={false} schemaName={"number"} qualifierMessage={undefined} schema={{"type":"number","example":1000}}></SchemaItem><SchemaItem collapsible={false} name={"message"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"X-Plex-Client-Identifier is missing"}}></SchemaItem><SchemaItem collapsible={false} name={"status"} required={false} schemaName={"number"} qualifierMessage={undefined} schema={{"type":"number","example":400}}></SchemaItem><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}>]</div></li></div></details></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"errors\": [\n {\n \"code\": 1000,\n \"message\": \"X-Plex-Client-Identifier is missing\",\n \"status\": 400\n }\n ]\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem></ApiTabs></div></div>