> For the complete documentation index, see [llms.txt](https://dev.ishare.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.ishare.eu/version-2.1.1/service-provider-role/getting-started/service.md).

# Service

This page contains an example implementation for a REST endpoint of a Service Provider, using the token obtained from the iSHARE [/token](/version-2.1.1/all-roles-common-endpoints/access-token-m2m.md) endpoint and the delegation evidence obtained from the [/delegation](/version-2.1.1/authorisation-registry-role/delegation-endpoint.md) endpoint.

## Example endpoint for Service Provider (parameters apply to other HTTP methods as well)

> This is an example service (business specific) endpoint to show how any Service Provider that adheres to iSHARE MUST apply iSHARE conformant OAuth to every iSHARE enabled service.\
> Request can make use of any HTTP method and can contain any extra headers. For convenience this documentation only defines the GET method. Parameters are undefined because they vary for each Service Provider due to their business specific logic. Note: Additional headers for security, statefulnes, application functionality could be added and is out of scope of this specification.

```json
{"openapi":"3.0.0","info":{"title":"generic iSHARE API specifications","version":"2.1.1"},"tags":[{"name":"Service Provider","description":"Endpoints that form the Service Provider API specification."}],"servers":[{"description":"iSHARE UAT network base domain","url":"https://isharetest.net"},{"description":"iSHARE TEST network base domain","url":"https://test.ishareworks.nl"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"OAuth 2.0 authorization based on bearer token. MUST contain “Bearer “ + access token value. Must be provided if restricted endpoints are needed."}},"parameters":{"delegation_evidence_header":{"name":"delegation_evidence","description":"iSHARE delegation evidence regarding the requested service. The Service  Consumer can obtain this evidence from an Authorization Registry /  Entitled Party before requesting a specific service.","schema":{"type":"string"},"in":"header"},"service_consumer_id_token_sc":{"name":"service_consumer_assertion","description":"iSHARE specific optional client assertion. Used when a Service Consumer is requesting a service on behalf of another Service Consumer in a  'service broker' pattern. It is used to prove that the 'brokering'  Service Consumer indeed has had a request from the original Service  Consumer","schema":{"type":"string"},"in":"header"},"purpose":{"name":"LicensePurpose","description":"Optional iSHARE specific value describing the purpose of the license the Service Consuming Entity requests for the data in the service response","schema":{"type":"string"},"in":"header"},"service_headers":{"name":"Service-Headers","description":"Any service specific headers","schema":{"type":"string"},"in":"header"}},"schemas":{"service_content":{"properties":{"service_content_1":{"type":"string"},"service_content_n":{"type":"string"}}}}},"paths":{"/service":{"get":{"tags":["Service Provider"],"parameters":[{"$ref":"#/components/parameters/delegation_evidence_header"},{"$ref":"#/components/parameters/service_consumer_id_token_sc"},{"$ref":"#/components/parameters/purpose"},{"$ref":"#/components/parameters/service_headers"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/service_content"}}},"description":"OK"}},"operationId":"/service","summary":"Example endpoint for Service Provider (parameters apply to other HTTP methods as well)","description":"This is an example service (business specific) endpoint to show how any Service Provider that adheres to iSHARE MUST apply iSHARE conformant OAuth to every iSHARE enabled service.\nRequest can make use of any HTTP method and can contain any extra headers. For convenience this documentation only defines the GET method. Parameters are undefined because they vary for each Service Provider due to their business specific logic. Note: Additional headers for security, statefulnes, application functionality could be added and is out of scope of this specification."}}}}
```
