Updated Transaction Upload API (markdown)

Tom Bloor 2017-04-19 22:36:29 +01:00
parent 757e2ba485
commit 01c863f917

@ -15,9 +15,9 @@ The JSON can be one of the following types:
* Known but Unvalidated Organisation
* Unknown Organisation
### Known and Validated Organisation
### Request JSON
Request JSON
#### Known and Validated Organisation
```
{
@ -28,7 +28,7 @@ Request JSON
}
```
### Known but Unvalidated Organisation
#### Known but Unvalidated Organisation
```
{
@ -39,7 +39,7 @@ Request JSON
}
```
### Unknown Organisation
#### Unknown Organisation
```
{
@ -53,4 +53,39 @@ Request JSON
}
```
**Note** `street_name` and `postcode` are optional.
**Note** `street_name` and `postcode` are optional.
### Response JSON
#### Success
Response code of `200 OK`
```
{
success : true,
message : 'Upload Successful'
}
```
#### Failure
If something is missing from the request, or is invalid, you will get a response code of `400 BAD REQUEST` and the following:
```
{
success : false,
message : <error message>
}
```
If there was a server error, you will get a `500 SERVER ERROR` and possibly the following:
```
{
success : false,
message : 'An unknown error occurred when adding the transaction'
}
```
The error messages should describe what was wrong with the submission