/C2-G27-Back

Backend for the dashboard.

Primary LanguageJavaScript

Fintech

GET | main path

https://fintech-no-contry.herokuapp.com

AUTHORIZATION
none

Example Request | main path

const requestOptions = {
  method: 'GET',
  redirect: 'follow',
};

fetch('https://fintech-no-contry.herokuapp.com', requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log('error', error));

POST | login path

https://fintech-no-contry.herokuapp.com/api/v1/auth/login

AUTHORIZATION API Key
Key api
Value key

Example Request | login

const raw = { username: 'username', password: 'password' };

const requestOptions = {
  method: 'POST',
  body: JSON.stringify(raw),
  redirect: 'follow',
  headers: {
    api: 'apiKey',
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
};

fetch(
  'https://fintech-no-contry.herokuapp.com/api/v1/auth/login',
  requestOptions
)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log('error', error));

GET | users

https://fintech-no-contry.herokuapp.com/api/v1/users

AUTHORIZATION Bearer Token
Token token

Example Request | users

const token = 'token';

const requestOptions = {
  method: 'GET',
  redirect: 'follow',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
};

fetch('https://fintech-no-contry.herokuapp.com/api/v1/users', requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log('error', error));

GET | user

https://fintech-no-contry.herokuapp.com/api/v1/users

AUTHORIZATION Bearer Token
Token token

Example Request | user

const token = 'token';

const requestOptions = {
  method: 'GET',
  redirect: 'follow',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
};

fetch(
  'https://fintech-no-contry.herokuapp.com/api/v1/users/{id}',
  requestOptions
)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log('error', error));

POST | user

https://fintech-no-contry.herokuapp.com/api/v1/users

AUTHORIZATION Bearer Token
Token token

Example Request | Create user

const raw= {
    "username": "username",
    "email": "example@example.com",
    "password": "password"
    "role": "admin"
    "peopleId":"peopleId"
};

const token = 'token';

const requestOptions = {
  method: 'POST',
  body: raw
  redirect: 'follow',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
};

fetch('https://fintech-no-contry.herokuapp.com/api/v1/users', requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log('error', error));

PUT | Update users

https://fintech-no-contry.herokuapp.com/api/v1/users

AUTHORIZATION Bearer Token
Token token

Example Request | Update user

const raw= {
    "username": "username",
    "email": "example@example.com",
    "password": "password"
    "role": "admin"
    "peopleId":"peopleId"
};

const token = 'token';

const requestOptions = {
  method: 'PUT',
  body: raw
  redirect: 'follow',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
};

fetch('https://fintech-no-contry.herokuapp.com/api/v1/users/{id}', requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log('error', error));

DELETE | Delete user

https://fintech-no-contry.herokuapp.com/api/v1/users

AUTHORIZATION Bearer Token
Token token

Example Request | Delete user

const token = 'token';

const requestOptions = {
  method: 'DELETE',
  redirect: 'follow',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
};

fetch(
  'https://fintech-no-contry.herokuapp.com/api/v1/users/{id}',
  requestOptions
)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log('error', error));

GET | people

https://fintech-no-contry.herokuapp.com/api/v1/people

AUTHORIZATION Bearer Token
Token token

Example Request | people

const token = 'token';

const requestOptions = {
  method: 'GET',
  redirect: 'follow',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
};

fetch('https://fintech-no-contry.herokuapp.com/api/v1/people', requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log('error', error));

GET | person

https://fintech-no-contry.herokuapp.com/api/v1/people

AUTHORIZATION Bearer Token
Token token

Example Request | person

const token = 'token';

const requestOptions = {
  method: 'GET',
  redirect: 'follow',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
};

fetch(
  'https://fintech-no-contry.herokuapp.com/api/v1/people/{id}',
  requestOptions
)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log('error', error));

POST | person

https://fintech-no-contry.herokuapp.com/api/v1/people

AUTHORIZATION Bearer Token
Token token

Example Request | Create person

const raw= {
    "name":"name",
    "lastName":"lastname",
    "user":{
        "username": "username",
        "email": "example@example.com",
        "password": "password",
        "role": "admin"
        }
};

const token = 'token';

const requestOptions = {
  method: 'POST',
  body: raw
  redirect: 'follow',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
};

fetch('https://fintech-no-contry.herokuapp.com/api/v1/people/', requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log('error', error));

PUT | Update people

https://fintech-no-contry.herokuapp.com/api/v1/people

AUTHORIZATION Bearer Token
Token token

Example Request | Update person

const raw= {
    "name":"name",
    "lastName":"lastname",
    "user":{
        "username": "username",
        "email": "example@example.com",
        "password": "password",
        "role": "admin"
        }
};

const token = 'token';

const requestOptions = {
  method: 'PUT',
  body: raw
  redirect: 'follow',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
};

fetch('https://fintech-no-contry.herokuapp.com/api/v1/people/{id}', requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log('error', error));

DELETE | Delete person

https://fintech-no-contry.herokuapp.com/api/v1/people

AUTHORIZATION Bearer Token
Token token

Example Request | Delete person

const token = 'token';

const requestOptions = {
  method: 'DELETE',
  redirect: 'follow',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
};

fetch(
  'https://fintech-no-contry.herokuapp.com/api/v1/people/{id}',
  requestOptions
)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.log('error', error));