EOSC Portal APIs for Providers & Thematic Catalogues EOSC Enhance
24 Slides5.22 MB
EOSC Portal APIs for Providers & Thematic Catalogues EOSC Enhance – NI4OS joint Webinar – 25/10/2021 George Papastefanatos, University of Athens
Application Programming Interfaces
Marketplace Onboarding Provider Portal PID Provisioning EOSC CORE Services Notify Changes EOSC Portal Service Catalogue Catalogues Providers Resources User Activity Interoperability Layer EOSC Portal Messaging Services AAI Services EOSC Portal ResourceSync Services https://providers.eosc-portal.eu/api/resourcesync/ AAI Services EOSC Portal REST API https://providers.eosc-portal.eu/openapi Obtain API Access Token Obtain API Service Token 3 2 Authorize 1 Onboarding Team Service catalogues EOSC Profiles Operations Register Providers Register Resources Update Providers \ Resources Activate \ Deactivate Providers Get my providers & resources (TBD) EOSC Profiles Operations Register Resources Update Providers \ Resources Activate \ Deactivate Resource Get my resources (TBD) 2 3 Register Provider 1 Individual Providers Onboarding Team EOSC Exchange
How to use the EOSC Portal API Individual Providers Service Catalogues 1. The Representative (Provider Admins) onboards the Provider and one Resource at the EOSC Portal Web Interface. 1. The Representative (Catalogue Admins) registers catalogue in the EOSC portal (RoP to be defined) 2. The Representative obtains an EOSC Portal API token to be used for authorization. 2. The Representative obtains an EOSC Portal API token to be used for authorization. 3. The Provider organization uses the API methods [1] to manage Resources in the EOSC Portal. 3. The Provider organization uses the API methods [1] to onboard & manage Providers & Resources in the EOSC Portal.
How to use the EOSC Portal API Individual Providers Service Catalogues 1. The Representative (Provider Admins) onboards the Provider and one Resource at the EOSC Portal Web Interface. 1. The Representative (Catalogue Admins) registers catalogue in the EOSC portal (RoP to be defined) 2. The Representative obtains an EOSC Portal API token to be used for authorization. 2. The Representative obtains an EOSC Portal API token to be used for authorization. 3. The Provider organization uses the API methods [1] to manage Resources in the EOSC Portal. Operational 3. The Provider organization uses the API methods [1] to onboard & manage Providers & Resources in the EOSC Portal. Proof of concept
1. Onboarding to the EOSC Portal
Onboarding to the EOSC Portal Provider Administrators This step is a prerequisite for the EOSC Portal API activation, since it accommodates qualified population of the EOSC Portal. This step is performed only once; upon completion, the EOSC Provider is onboarded at the EOSC Portal and the representative, who is the provider’ admin in the EOSC portal, can start using the EOSC Portal API Catalogue providers contact EPOT before granting access
2. Obtaining an EOSC Portal API token
EOSC Portal API token The Provider (or Catalogue) Admins obtain an Access and a Refresh token by signing into the AAI service of the EOSC Portal [1]. Access tokens are valid for 1 hour Refresh Tokens are valid for 12months Access token is used in the Authorization header when making requests to the EOSC Portal. The token is required when pushing information with PUT\PUSH methods The token is not required in GET methods. https://aai.eosc-portal.eu/providers-api/
EOSC Portal API token Use Access token in API calls export access token access token value curl \ --header "Authorization: Bearer access token" \ --header "Content-Type: Application/json" \ --data " escapedJson" \ https://sandbox.providers.eosc-portal.eu/api/provider Use Refresh Token to issue new access token curl -X POST 'https://aai.eosc-portal.eu/oidc/token' -d 'grant type refresh token&refresh token refresh token value &client id 2373c5f0-c4bd4918-aea3-f8bac3819f49&scope openid%20email%20profile' python -m json.tool; Manage all your Access/Refresh Tokens that you have obtained by the EOSC Portal AAI. https://aai.eosc-portal.eu/oidc/manage/user/services https://aai.eosc-portal.eu/providers-api/
3. Using the API methods
Using the API methods EOSC Portal APIs Use SSL - https:// EOSC Portal APIs Base URLs https://api.eosc-portal.eu/ {Base URLs}/{method} https://api.eosc-portal.eu/resource/all https://api.eosc-portal.eu/resource/all
Using the API methods EOSC Portal API methods: GET methods: to retrieve information from the EOSC Portal. POST methods: to create and validate a new Resource at the EOSC Portal. PUT methods: to update information at the EOSC Portal. The available methods are organized in Provider and Resource-specific controllers
Using the API methods To insert or update Resources at the EOSC Portal, these Resources need to be represented in JSON format, adhering to the EOSC Portal Profiles EOSC Portal Profiles are currently in v3.00. Examples of Resources represented in JSON format and adhering to the EOSC Portal Profiles are provided by expanding each API method [1]. Example EOSC Portal API calls for several API methods are provided in the next sections.
Provider Controller push /provider Catalogue admin adds a new Provider and returns a new ID patch /provider/verifyProvider/ PROVIDER ID NI4OS proof of concept Catalogue admin verifies the registration of provider put /provider Updates the Provider assigned the given id with the given Provider, keeping a version of revisions.
Provider Controller get /provider/all Filter a list of Providers based on a set of filters or get a list of all Providers in the Catalogue. get /provider/services/{id} Get a list of services offered by a Provider. get /provider/{id} Returns the Provider with the given id
Resource Controller – Post\Put methods post /resource Creates a new Resource. put /resource Updates the Resource assigned the given id with the given Resource, keeping a version of revisions post /resource/validate Validates the Resource without actually changing the repository
Resource Controller – Get methods get /resource/{id} Get the most current version of a specific Resource, providing the Resource id. get /resource/all Filter a list of Resources based on a set of filters or get a list of all Resources in the Catalogue. get /resource/by/{field} Get all Resources in the catalogue organized by an attribute, e.g. get Resources organized in categories. get /resource/byID/{ids} Get a list of Resources based on a set of ids. get /resource/{id}/{version} Get the specified version of a Resource, providing the Resource id and version
Vocabulary Controller – Get methods get /vocabulary/byType Get all vocabulary entries organized per type get /vocabulary/byType/{type} Get a list of vocabulary entries for the given specific type get /vocabulary/{id} Get a vocabulary entry by id get /vocabulary/countries/EU Returns a list of EU countries. get /vocabulary/countries/WW Returns a list of WW countries.
Providers Component endpoints EOSC Portal APIs documentation https://providers.eosc-portal.eu/openapi EOSC Portal Environments Production: https://providers.eosc-portal.eu/openapi Changes update the public catalogue Sandbox: https://sandbox.providers.eosc-portal.eu/openapi Stable Replica of production. Used as a playground for API and end users. Changes DO NOT update the public catalogue Beta: https://beta.providers.eosc-portal.eu/openapi Beta features and early releases. Changes DO NOT update the public catalogue
Preparatory Work for Profiles-3.10
Preparatory Work for Profiles-3.10 New main entity: Catalogue A catalogue hosts metadata about Services and Providers Maintained by a Catalogue provider Can be external (NI4OS, OpenAIRE, etc.) or EOSC itself Each service may be registered to one catalogue. Register catalogue Approve catalogue Manage services and providers
Catalogue onboarding process