Giter Club home page Giter Club logo

hmrc.api-example-microservice's Introduction

API Example Microservice

This is an API example to test the API platform. It has 3 endpoints, one for each level of authorisation (open, application-restricted and user-restricted).

hello-world

This is an open resource (hence it doesn't require any type of authorisation)

request:

GET /hello/world

response:

{
    "message":"Hello World"
}

In the API definition, authType should be set to NONE

"authType": "NONE"

hello-application

This is an application-restricted resource (hence it requires an OAuth 2.0 token in the Authorization header)

request:

GET /hello/application

response:

{
    "message":"Hello Application"
}

In the API definition, authType should be set to APPLICATION

"authType": "APPLICATION"

hello-user

This is a user-restricted resource (hence it requires an OAuth 2.0 token generated with the authorization code grant in the Authorization header`)

request:

GET /hello/user

response:

{
    "message":"Hello User"
}

In the API definition, authType should be USER

"authType": "USER"

Sandbox

All endpoints are accessible on sandbox with /sandbox prefix on each endpoint, e.g.

GET /sandbox/hello/world
GET /sandbox/hello/application
GET /sandbox/hello/user

Definition

API definition for this service will be available under /api/definition endpoint. See definition in /resources/public/api/definition.json for the format.

Version

Version of API need to be provided in Accept request header

Accept: application/vnd.hmrc.v1.0+json or
Accept: application/vnd.hmrc.v2.0+json or
Accept: application/vnd.hmrc.v1.0+xml or
Accept: application/vnd.hmrc.v2.0+xml

Run tests

sbt test
sbt it:test
sbt component:test

License

This code is open source software licensed under the Apache 2.0 License

hmrc.api-example-microservice's People

Contributors

peteslater-ee avatar rose-garratt avatar anjumabbas5 avatar billymitchell14 avatar d6fb avatar adampridmore avatar lburgos avatar andyspaven avatar hmrc-web-operations avatar fluentsynergydw avatar cjrowe avatar gokyo avatar stewabel avatar tomasz-rosiek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.