Plex API For Developers - Microsoft

3y ago
116 Views
9 Downloads
932.20 KB
32 Pages
Last View : 2d ago
Last Download : 2m ago
Upload by : Jayda Dunning
Transcription

Plex API for Developers

PLEX SYSTEMS, INC. PRIVILEGED AND CONFIDENTIAL INFORMATION.Copyright 2017. Plex Systems, Inc. All Rights Reserved.PERMISSION TO COPY, MODIFY, AND/OR DISTRIBUTE THIS DOCUMENT WITHOUT THE PRIORWRITTEN CONSENT OF PLEX SYSTEMS, INC. IS STRICTLY PROHIBITED. NO PART OF THISDOCUMENT MAY BE REPRODUCED, STORED IN A RETRIEVAL SYSTEM, DISSEMINATED, ORTRANSMITTED IN ANY FORM OR BY ANY MEANS, ELECTRONIC, MECHANICAL, PHOTOCOPYING,RECORDING, OR OTHERWISE, WITHOUT THE PRIOR WRITTEN PERMISSION OF PLEX SYSTEMS,INC.

ContentsPLEX API FOR DEVELOPERS . 1API development process . 1Plex API terms and concepts . 2About REST web services . 2API URL structure . 2Request headers . 2HAL-formatted responses . 4UTC time . 4Plex API terms. 5Getting started with the Plex API . 9Create a Plex service account . 9Obtain a client ID and secret . 10Sign up for a Plex API developer account . 11Test your account . 11Navigating the Plex Developer Portal . 15Sign in to the Plex Developer Portal . 15View announcements . 16View and test an API . 16View and subscribe to an adapter . 18Access connectors . 19Access your profile . 19Using the Plex Workcenter Lookup app . 20Plex Workcenter Lookup app requirements . 20Add the Plex Workcenter Lookup app . 21Run the Plex Workcenter Lookup app . 21Troubleshooting . 24400 - Bad request . 24401 - Expired token. 24401 - Invalid client secret . 25403 – Access restricted resource . 25403 - Failed to get authorization token . 26403 - Usage Quota . 26404 – Resource not found . 26429 - Usage limiting . 27500 - Unknown error . 27

Plex API for DevelopersPage 1Plex API for DevelopersThe Plex RESTful web service application programming interface (API) is a collection ofpublic endpoints that provide access to resources and data in the Plex manufacturingcloud. Designed according to the representational state transfer (REST) softwarearchitectural style, the Plex API uses standard HTTP verbs and a RESTful endpointstructure. Authorization is handled using OAuth 2.0.You can access the Plex Developer Portal at https://dev.plex.com/.API DEVELOPMENT PROCESSThe high level process for application development in the Plex RESTful applicationframework typically includes the following tasks:Customers with access to Plex UX create an application placeholderusing the Client Applications screen. Based on the application nameand the associated service account, Plex generates a client ID andsecret, which are used to identify the application when it accesses thePlex manufacturing cloud.Customers with a Plex API developer account subscribe to APIadapters (collections of APIs) in the Plex Developer Portal. Once asubscription request is approved, the account is given a primary andsecondary subscription key that grants access to the adapter and itsassociated endpoints.Customers develop the application using appropriate developmenttools such as Postman and Visual Studio. The application is coded touse OAuth 2.0 authentication to receive an access token that enablesit to interface with Plex RESTful API web services.Customers run the application, which traverses the OAuth sequence,retrieves access tokens, and accesses the Plex manufacturing cloud,where data is created, retrieved, or edited.Plex Systems, Inc.

Page 2Plex API for DevelopersPLEX API TERMS AND CONCEPTSThis section defines fundamental terms and concepts for the Plex API.About REST web servicesRepresentational State Transfer (REST) is an architectural style that specifiesconstraints, such as the uniform interface, that if applied to a web service inducedesirable properties that enable services to work best on the web, such as performance,scalability, and modifiability.Key points about REST include: REST is a web service like SOAP but arguably better.Plex implements REST request and response messages as Hypertext ApplicationLanguage (HAL) and JavaScript Object Notation (JSON).REST uses self-describing messages.REST provides stateful interactions through hyperlinks.API URL structureManaged endpoints have the following form:https://api.plex.com.net[/test/]{web API URL kcenterProductionLogs/{WorkcenterKey}?EndDate {EndDate}&StartDate {StartDate}Request headersSubscription key headerAll Plex API requests require a valid subscription key header. The request headerOcp-Apim-Subscription-Key is a subscription key which provides access to the API.These subscription keys are located in your account profile on the Plex Developer Portal.If you neglect to include the subscription key header in an API request, you will receive thefollowing response:{"statusCode": 401,"message": "Access denied due to missing subscription key. Make sure to includesubscription key when making requests to an API."}Plex Systems, Inc.

Plex API for DevelopersPage 3If your header has an invalid subscription key, you will receive the following response:{"statusCode": 401,"message": "Access denied due to invalid subscription key. Make sure to providea valid key for an active subscription."}Bearer token headerAll Plex API requests require a valid bearer token in the header. The OAuth2 bearer tokenis obtained from the Authorization API, which is the OAuth2 token endpoint. Note thisresource requires your Plex-provided client ID and the URL-encoded form of yourPlex-provided client secret.The bearer token header consists of two related values: Authorization and Bearer [yourbearer token].If you neglect to include the authorization header, you will receive the following response:{"statusCode": 401,"message": "Not authorized: Authorization header value not present."}If you neglect to include the bearer token, you will receive the following response:{"statusCode": 401,"message": "Unauthorized. Access token is missing or invalid. Verify the tokenis in the Authorization Header with the token type 'Bearer'. Make certain thetoken is not expired. Use an inspection tool such as https://jwt.io/ and verifyall expected claims are present, including exp, iat, nbf, etc. Make sure thetoken was requested from the Plex token endpoint with resourcehttp://api.plex.com/."}Plex Systems, Inc.

Page 4Plex API for DevelopersHAL-formatted responsesThe typical JSON response is consistently delivered in a simple format that helps to makethe Plex API easy to explore and learn.The basic format of the response with the generic application/hal json media type is thefollowing: LinksEmbedded returned resourcesState information (instance record count and total record count)Example:{"links": [{"rel": "self","href": "./.","method": "GET"},{"rel": "next","href": "./.&offset 10&limit 10","method": "GET"},{"rel": "last","href": "./.&offset 10&limit 10","method": "GET"}],"embedded": [{FIRST RETURNED OBJECT},{SECOND RETURNED OBJECT},.,{NTH RETURNED OBJECT}],"total": ##,"count": ##}UTC timePlex API responses return all dates in Coordinated Universal Time (UTC). Clientapplications must take this into account.Plex Systems, Inc.

Plex API for DevelopersPage 5Plex API termsadapterAn adapter is a set of related Plex Connect APIs. You must subscribe to an adapterbefore you can access it.adapter subscriptionHigh level access to Plex Connect adapters is managed using a subscription system.A confirmed subscription to an adapter grants access to the adapter and is used asan identifier for analytics, auditing, and any usage constraints.APIAn Application Programming Interface (API) is a set of routines, protocols, and toolsfor building applications. A Plex API in the Plex Developer Portal is a collection ofrelated endpoints analogous to one or more Plex software modules.authorization code grantAn OAuth 2.0 authentication flow where access is delegated to a client application.The transaction is protected and mediated by a code grant, which is exchanged foran access token. The client application never sees the user's credentials and theuser agent never sees the access token.authorization headerWith OAuth 2.0 authorization over HTTP, the client application uses the HTTPheader to submit a bearer token to the API.bearer tokenA bearer token is a unique string that is used to access OAuth 2.0 protectedresources.client credentials grantA form of authentication known as 2-legged OAuth. Instead of user names andpasswords, access tokens are used to gain access to PCN data. The OAuth 2.0client credentials grant flow permits an unattended, confidential client to use its owncredentials to authenticate when calling another web service, instead ofimpersonating a user. In this scenario, the client is typically a middle-tier web service,daemon service, or web site.Plex Systems, Inc.

Page 6Plex API for Developersbusiness process APIThese practical APIs have usability characteristics that distinguish them frominfrastructure-level system APIs, such as requiring minimal programming to beusable by a broader range of developers, including HTML designers and higher-levelcodersclient IDA client ID is a unique string, typically a machine-generated Globally UniqueIdentifier (GUID), which represents a registered client application.client secretA client secret is a unique string that is used as a password for a registered clientapplication when the client application is on a confidential client. The client secrethas an expiration date and should be kept secure.connectorA connector is a finished product that relies on one or more Plex Connect APIs.Connectors are pre-built and certified integrations with solution alliance partners,where both solutions are integrated in a manner that is within the scope of an allianceagreement. Connectors are supported by Plex and are licensable in conjunction withintegrating solutions into Plex.Developer PortalThe Plex Developer Portal is the site where developers can learn about andexperiment with Plex APIs. The portal also provides developers with the opportunityto collaborate and share their experiences with the Plex API.endpointThe “endpoint” of the API is a unique URL that represents a resource.Hypertext Application Language (HAL)The Hypertext Application Language (HAL) is an Internet Draft standard conventionthat defines links to resources within JSON. HAL imposes a structured way torepresent resource links in some of our standard data as part of the HATEOASconstraint of the REST application architecture.Plex Systems, Inc.

Plex API for DevelopersPage 7JSON responseJSON (JavaScript Object Notation) is an open-standard format that useshuman-readable text to transmit data objects consisting of attribute–value pairs.Response bodies from the API are in JSON format.operationThe combination of an endpoint with an HTTP verb.primary keyIn Plex normalized database tables, a unique, “primary” key of one or more attributesidentifies each data row.profileThe set of subscriptions, identifiers, and other attributes of a Plex Developer Portaluser.resourceA resource is an object with attributes, relationships to other resources, and a set ofmethods that operate on it. It is similar to an object instance in an object-orientedprogramming language, with the important difference that only a few standardmethods are defined for the resource (corresponding to the standard HTTP GET,POST, PUT and DELETE methods), while an object instance typically has manymethods.RESTRepresentational state transfer (REST) is a software architectural style that focuseson component roles and a specific set of interactions between data elements ratherthan implementation details. Web services that conform to REST constraints areknown as RESTful.REST systems typically communicate over HTTP using the same HTTP verbs thatweb browsers use to retrieve web pages and to send data to remote servers.RESTful verbs include:GET resource PUT resource POST resource DELETE resource Plex Systems, Inc.

Page 8Plex API for Developerssecondary keyAn additional user-controlled subscription key.service accountFor the purposes of 2-legged OAuth 2.0 (2LO), a service account is a type of Plexuser account.sprocsStructured Query Language (SQL) stored procedures. A stored procedure is anapplication subroutine that is used to interact with a database.system APIService APIs provide internal interfaces into specific, low-level capabilities such asdatabase, messaging, and storage.tokenIn the OAuth authorization standard, tokens are signed strings that are used tovalidate access authorization.token endpointThe token endpoint is the URL from which a proper request returns a token.Plex Systems, Inc.

Plex API for DevelopersPage 9GETTING STARTED WITH THE PLEX APIThis section contains information on the steps necessary to obtain access to the Plex APIfor use with custom applications.Create a Plex service accountYou must create a Plex service account to associate with Plex API applications that usethe client credentials grant.1. In Plex UX, create a new user account:a. Access the User Manager.b. On the Action Bar, click Add.c. On the New User screen, provide the following information, at a minimum: First Name Last Name User ID Password Position Departmentd. In the Security Roles section, select the Member check box for each security rolethat you want to assign to the service account.Note: The service account must have sufficient security privileges for the APIapplications that are associated with the account to interact with related areas ofthe system. For example, if you have a custom application that uses the API to listpart records, you must assign to the service account the security roles that areused by your organization to control access to appropriate actions from the PartList module.e. Click OK.The service account is created.Plex Systems, Inc.

Page 10Plex API for Developers2. Give the user account access to Plex UX:a. Access the Cloud Access screen.b. Adjust the search filters to locate the user account, and click Search.c. In the search results, in the Name column, click the account name.d. On the User Access Setup Detail screen, for Default Customer, specify thePCN.e. Click OK.Obtain a client ID and secretYou must register your application with Plex to receive a client ID and secret. The client IDand secret are used to obtain an OAuth 2.0 bearer token, which your application will useto access the Plex manufacturing cloud. A client ID and secret are also required to try outPlex API operations within the Plex Developer Portal.1.2.3.4.5.In Plex UX, access the Client Applications screen.On the Action Bar, click Add.On the Client Applications form, for Display Name, type your application name.In the Homepage URI box, type the full address of your application.In the Unique Identifier URI box, type an identifier.6. If your account is associated with multiple PCNs, select the PCN that you want to use.7. In the PUN box, type the Plex User ID for the account.8. If you want to limit the account to test tier data, select the Test Only check box.Note: With Test Only turned on, calls to managed production endpoints return aresponse stating that the application is not allowed to access production resources.9. Click Apply.The client ID is generated for your application and the screen updates to display theinformation. This can take several minutes to complete.10. In the Client Credentials section, click Secrets Grid.11. On the Client Applications Secrets screen, on the Action Bar, click Add.On the Client Applications Add Secret screen, a generated secret is displayed.12. Record the secret and keep it in a secure place.Important: Once you click OK and navigate away from the Client Applications AddSecret screen, you cannot retrieve the secret.13. Click OK.Plex Systems, Inc.

Plex API for DevelopersPage 11Sign up for a Plex API developer accountYou must have a Plex API developer account before you can access Plex RESTful APIs.1. In Plex, create a USR to request an API developer account. Include the email addressthat you want to associate with the account.Plex will review your request and send a confirmation email to your email address.2. In the confirmation email, click the verification link.3. Update the USR and wait for Plex to process your verified user account.Test your accountIf you have a Plex API developer account, you can test Plex APIs directly within

API An Application Programming Interface (API) is a set of routines, protocols, and tools for building applications. A Plex API in the Plex Developer Portal is a collection of related endpoints analogous to one or more Plex software modules. authorization code grant An OAuth 2.0 authentication flow where access is delegated to a client application.

Related Documents:

Bio-Plex Rat Serum Diluent Kit 171-305008 (1 x 96) Bio-Plex rat serum sample diluent 15 ml Bio-Plex rat serum standard diluent 10 ml Catalog # Bio-Plex 200 Suspension Array 171-000201 System or Luminex System* Bio-Plex 200 Suspension Array 171-000205 System With High-Throughput Fluidics

Bruksanvisning för bilstereo . Bruksanvisning for bilstereo . Instrukcja obsługi samochodowego odtwarzacza stereo . Operating Instructions for Car Stereo . 610-104 . SV . Bruksanvisning i original

api 20 e rapid 20e api 20 ne api campy api nh api staph api 20 strep api coryne api listeriaapi 20 c aux api 20 a rapid id 32 a api 50 ch api 50 chb/e 50 chl reagents to be ordered. strips ref microorganisms suspension inoculum transfer medium i

Latest API exams,latest API-571 dumps,API-571 pdf,API-571 vce,API-571 dumps,API-571 exam questions,API-571 new questions,API-571 actual tests,API-571 practice tests,API-571 real exam questions Created Date

3 API Industry Guide on API Design Apiary - Apiary jump-started the modern API design movement by making API definitions more than just about API documentation, allowing API designers to define APIs in the machine-readable API definition format API blueprint, then mock, share, and publish

The E-Plex Standard software enables you to program and audit Kaba's E-Plex 5000 and 3000 battery operated electronic pushbutton locks. Simply by using this software, the user of the E-Plex 5000 and 3000 can conveniently . Master code before doing any programming on the lock. 12. Audit the locks using the maintenance Unit. 13. Transfer Lock .

10 tips och tricks för att lyckas med ert sap-projekt 20 SAPSANYTT 2/2015 De flesta projektledare känner säkert till Cobb’s paradox. Martin Cobb verkade som CIO för sekretariatet för Treasury Board of Canada 1995 då han ställde frågan

hydrate (C–S–H), ettringite, and Ca(OH) 2 through a hydration reaction in which hydration heat is produced within the concrete because of an exothermic reaction. Since the thermal cracking of concrete reduces its internal force, watertightness, and durability, an appropriate measure is required to control the heat of hydration. The factors that influence the hydration heat of concrete .