Description of each API endpoint used in this app is listed here. The type of resource is listed along with a short description. Any params or config objects are shown too along with response schema. Examples are also shown in JavaScript.
The sign in is a POST request that takes in a params object. When the user is signed in, a JWT is returned.
Params | Type | Description |
---|---|---|
string | User's email (Required) | |
password | string | User's password (Required) |
Example of sign in (JS) using axios:
const params = {
user: {
email: "[email protected]",
password: "12345",
},
};
const response = await authApi.post('/users/sign_in', params);
Successful Response | Type | Description |
---|---|---|
data | JSON | "Successfully authenticated" |
status | integer | 200 OK |
authorization | string | The JWT |
Unsuccessful Response | Type | Description |
---|---|---|
data | JSON | "Something went wrong with API sign in :(" |
status | integer | 401 Unauthorized |
The sign out is a GET request that takes in a config object. When the user is signed out, the JWT is removed from app state and async storage.
Config | Type | Description |
---|---|---|
Authorization | string | JWT (Required) |
Example of sign out (JS) using axios:
const config = {
headers: {
Authorization: "JWT goes here",
},
};
const response = await authApi.get('/users/sign_out', config);
Successful Response | Type | Description |
---|---|---|
data | JSON | "Successfully Signed Out" |
status | integer | 200 OK |
This route fetches (gets) all current casa cases for the signed in user. No params required. The JWT is required for every request.
Config | Type | Description |
---|---|---|
Authorization | string | JWT (Required) |
Example of fetching casa cases (JS) using axios:
TBD
Successful Response | Type | Description |
---|---|---|
data | JSON array of objects | [{...}, {...}, {...}...] |
status | integer | 200 OK |