-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from hmrc/SAR-70
SAR-70: Added the RAML documentation and JSON schemas et al.
- Loading branch information
Showing
6 changed files
with
240 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
resources/public/api/conf/1.0/examples/create-subscription-request-1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"email": "[email protected]", | ||
"acceptsTermsAndConditions": true | ||
} |
16 changes: 16 additions & 0 deletions
16
resources/public/api/conf/1.0/schemas/create-subscription-request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"description": "Create MTD IT Subscription", | ||
"type": "object", | ||
"properties": { | ||
"email": { | ||
"description": "The email address used to contact the user about their MTD IT service subscription", | ||
"type": "string" | ||
}, | ||
"acceptsTermsAndConditions": { | ||
"description": "A field to indicate whether the user agrees to the Terms & Conditions of the MTD IT service", | ||
"type": "boolean" | ||
} | ||
}, | ||
"required": ["email","acceptsTermsAndConditions"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
160 changes: 160 additions & 0 deletions
160
resources/public/api/documentation/1.0/Create-Subscription.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
<endpoint> | ||
<name>Create Subscription</name> | ||
<description>This endpoint allows users to subscribe to the Making Tax Digital for Business - Income Tax service.</description> | ||
|
||
<section id="resource"> | ||
<title>Resource</title> | ||
<resource>POST /income-tax/subscription</resource> | ||
</section> | ||
|
||
<section id="authorisation"> | ||
<title>Authorisation</title> | ||
<authorisation> | ||
<type>USER</type> | ||
<scope>write:income-tax</scope> | ||
</authorisation> | ||
</section> | ||
|
||
<section id="content-types"> | ||
<title>Accepted Media Types</title> | ||
<list> | ||
<item> | ||
<code>application/vnd.hmrc.1.0+json</code> | ||
</item> | ||
</list> | ||
</section> | ||
|
||
<section id="sample-request"> | ||
<title>Request</title> | ||
<json> | ||
<![CDATA[ | ||
{ | ||
"email": "[email protected]", | ||
"acceptsTermsAndConditions": true | ||
} | ||
]]> | ||
</json> | ||
</section> | ||
|
||
<section id="response"> | ||
<title>Response</title> | ||
<httpStatus>201 (CREATED)</httpStatus> | ||
</section> | ||
|
||
<section id="error-responses"> | ||
<title>Error Scenarios</title> | ||
<table> | ||
<headings> | ||
<cell>Error Scenario</cell> | ||
<cell>HTTP Status</cell> | ||
<cell>Error Code</cell> | ||
<cell>message</cell> | ||
</headings> | ||
<rows> | ||
<row> | ||
<cell> | ||
<code>Bad Request</code> | ||
</cell> | ||
<cell> | ||
<code>400 (Bad Request)</code> | ||
</cell> | ||
<cell> | ||
<code>BAD_REQUEST</code> | ||
</cell> | ||
<cell> | ||
<code>Bad Request</code> | ||
</cell> | ||
</row> | ||
|
||
<row> | ||
<cell> | ||
<code>Invalid request payload</code> | ||
</cell> | ||
<cell> | ||
<code>400 (Bad Request)</code> | ||
</cell> | ||
<cell> | ||
<code>BAD_REQUEST</code> | ||
</cell> | ||
<cell> | ||
<code>Invalid payload</code> | ||
</cell> | ||
</row> | ||
|
||
<row> | ||
<cell> | ||
<code>Unauthorized</code> | ||
</cell> | ||
<cell> | ||
<code>401 (Unauthorized)</code> | ||
</cell> | ||
<cell> | ||
<code>UNAUTHORIZED</code> | ||
</cell> | ||
<cell> | ||
<code>Bearer token is missing or not authorized</code> | ||
</cell> | ||
</row> | ||
<row> | ||
<cell> | ||
<code>Resource Not Found</code> | ||
</cell> | ||
<cell> | ||
<code>404 (Not Found)</code> | ||
</cell> | ||
<cell> | ||
<code>NOT_FOUND</code> | ||
</cell> | ||
<cell> | ||
<code>Resource was not found</code> | ||
</cell> | ||
</row> | ||
|
||
<row> | ||
<cell> | ||
<code>Accept header invalid</code> | ||
</cell> | ||
<cell> | ||
<code>406 (Not Acceptable)</code> | ||
</cell> | ||
<cell> | ||
<code>ACCEPT_HEADER_INVALID</code> | ||
</cell> | ||
<cell> | ||
<code>The accept header is missing or invalid</code> | ||
</cell> | ||
</row> | ||
|
||
<row> | ||
<cell> | ||
<code>Content-Type header invalid</code> | ||
</cell> | ||
<cell> | ||
<code>406 (Not Acceptable)</code> | ||
</cell> | ||
<cell> | ||
<code>CONTENT_TYPE_HEADER_INVALID</code> | ||
</cell> | ||
<cell> | ||
<code>The content type header is missing or invalid</code> | ||
</cell> | ||
</row> | ||
|
||
<row> | ||
<cell> | ||
<code>Internal Server Error</code> | ||
</cell> | ||
<cell> | ||
<code>500 (Internal Server Error)</code> | ||
</cell> | ||
<cell> | ||
<code>INTERNAL_SERVER_ERROR</code> | ||
</cell> | ||
<cell> | ||
<code>Internal server error</code> | ||
</cell> | ||
</row> | ||
</rows> | ||
</table> | ||
</section> | ||
</endpoint> |
Oops, something went wrong.