route: /login method: POST
Request Body
{
username: "username",
password: "password",
}`
Response
{
token: "zzsfgozkfgIAUSWO(URFE(FIEOF"
}
To send request route that requires login, add this to the header: Authorization: JWT <token>
route: /housing
method: GET
header: Authorization: JWT <token>
Response
[{}, {}...]
route: /housing
method: POST
header: Authorization: JWT <token>
Request body:
{
estate: "zlrgkfg",
firstName":"Oyetoke",
...
}
Response
{
message: "Created succesfully",
formID: "kENkf"
}
route: /housing/:formID
method: GET
header: Authorization: JWT <token>
Response
{
estate: "zlrgkfg",
firstName":"Oyetoke",
formID: "kENkf",
...
}
route: /housing/:formID
method: POST
header: Authorization: JWT <token>
Request body:
{
estate: "zlrgkfg",
firstName":"Toby",
...
}
Response
{
estate: "zlrgkfg",
firstName":"Oyetoke",
formID: "kENkf",
...
}
route: /upload
method: POST
header: Authorization: JWT <token>
Request body:
{
image: "<byte>",
formID: ""
...
}
Response
{
fileID: "jdj",
message: "Uploaded successfully"
...
}
route: /upload
method: GET
header: Authorization: JWT <token>
Response
[{}...]
route: /upload/:fileID
method: GET
header: Authorization: JWT <token>
Response
{
fileID: "sjflskf",
image: "lKSNs"
}
This contains addition body params base on the type of documents you are upload. You need to specify the type of documents you want to upload. If you send allocation_letter
as the type of the document, you need to send along the year
, or if you chose other
you'll need to send along description
. fileID
is the id of the file you uploaded using the upload file route.
route: /documents
method: POST
header: Authorization: JWT <token>
Request body:
{
type: "allocation_letter",
fileID: "9ofuffufifpfopfpfujpruf",
year: "2019",
description: ""
...
}
Response
{
uploadID: "fjljf",
message: "Uploaded successfully"
...
}
route: /documents
method: GET
header: Authorization: JWT <token>
Params body:
{
type: "allocation_letter",
...
}
Response
[{}, {}]
route: /estates
method: GET
header: Authorization: JWT <token>
Response
```js
[{}...]
To upload a document, you need to send two requests to same endpoint. The first one is to upload the file with a generated uuid and have it return a file_id
which is same as the uuid, the second one is to create a document object with the file_id
(guid), form_id
and extra info
You must generate a valid uuid known as guid
and send a post request along with it in the url. The header must contain Content-Disposition: inline filename=<name>;
route: /upload/<guid>
method: POST
header: Content-Disposition: inline filename=<name>;
body:
file: "some binary"
}
This step is to create a document object as mentioned earlier. Just send along, the file_id, description, year and form_id
route: /upload/<guid>
method: PUT
body:
file_id: <guid>,
description: "tobi ti pe ju",
year: null // 2018,
form_id: "83fjfd"
}```