Hello World API

Dates and amounts
Date Amount
Version and status
Available in Sandbox Yes
Sandbox base URL https://test-api.service.hmrc.gov.uk
Available in Production Yes
Production base URL https://api.service.hmrc.gov.uk

Overview

This is an example API that allows software developers to test that their applications can connect with the HMRC API Platform. It also acts as a hands-on tutorial for developers to get started with HMRC APIs.

It includes resources for testing access to the three different access levels:

  • Say hello world is an example of an unrestricted endpoint
  • Say hello user is an example of a user-restricted endpoint
  • Say hello application is an example of an application-restricted endpoint

Further details of the different access levels are given on the Authorisation page.

For more information about how to develop your own client applications, including example clients for this API, see Tutorials.

Versioning

When an API changes in a way that is backwards-incompatible, we increase the version number of the API. See our reference guide for more on versioning.

Errors

We use standard HTTP status codes to show whether an API request succeeded or not. They are usually in the range:

  • 200 to 299 if it succeeded, including code 202 if it was accepted by an API that needs to wait for further action
  • 400 to 499 if it failed because of a client error by your application
  • 500 to 599 if it failed because of an error on our server

Errors specific to each API are shown in the Endpoints section, under Response. See our reference guide for more on errors.

Skip to main content

Endpoints

/hello/world

Say hello world
GET

A simple example for integrating with an unrestricted service.

Any request to this endpoint initiates a 'Hello World' response.

Authorisation

This endpoint is open access and requires no Authorization header.

Request headers

Request headers Table
Name Description
Accept
required

Specifies the response format and the version of the API to be used.

For example: application/vnd.hmrc.1.0+json

See also fraud prevention.

Response

HTTP status: 200 (OK)

{
  "message" : "Hello World"
}


Close Section
/hello/user

Say hello user
GET

A simple example for integrating with a user-restricted service, using an OAuth 2.0 access_token.

Any authorised request to this endpoint initiates a 'Hello User' response.

Authorisation

This endpoint is user-restricted and requires an Authorization header containing an OAuth 2.0 Bearer Token with the hello scope.

Request headers

Request headers Table
Name Description
Accept
required

Specifies the response format and the version of the API to be used.

For example: application/vnd.hmrc.1.0+json
Authorization
required
An OAuth 2.0 Bearer Token with the hello scope.

For example: Bearer bb7fed3fe10dd235a2ccda3d50fb

See also fraud prevention.

Response

HTTP status: 200 (OK)

{
  "message": "Hello User"
}


Close Section
/hello/application

Say hello application
GET

A simple example for integrating with an application-restricted service, using an OAuth 2.0 access_token.

Any authorised request to this endpoint initiates a 'Hello Application' response.

Authorisation

This endpoint is application-restricted and requires an Authorization header containing an OAuth 2.0 Bearer Token.

Request headers

Request headers Table
Name Description
Accept
required

Specifies the response format and the version of the API to be used.

For example: application/vnd.hmrc.1.0+json
Authorization
required
An OAuth 2.0 Bearer Token.

For example: Bearer 59fc92c1cdf0b8ef1f138a702effdbd2

See also fraud prevention.

Response

HTTP status: 200 (OK)

{
  "message": "Hello Application"
}


Close Section

Skip to main content