Users


Get all users

        
fetch('https://fakegundamwikiapi.onrender.com/api/users', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN_HERE',
    'Content-Type': 'application/json'
  }
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
         
    

Get a single user

        
fetch('https://fakegundamwikiapi.onrender.com/api/users/1', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN_HERE',
    'Content-Type': 'application/json'
  }
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
         
    

Create a new user

        
fetch('https://fakegundamwikiapi.onrender.com/api/users', {
    method: 'POST',
    headers: {
        'Authorization': 'Bearer YOUR_TOKEN_HERE',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        'userName': 'User',
        'firstName': 'Prueba',
        'lastName': 'prueba',
        'password': '12345',
        'rolesId': [1]
    })
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
         
    

Update a user

        
fetch('https://fakegundamwikiapi.onrender.com/api/users/1', {
    method: 'POST',
    headers: {
        'Authorization': 'Bearer YOUR_TOKEN_HERE',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        'userId': 1,
        'userName': 'User',
        'firstName': 'Prueba',
        'lastName': 'prueba',
        'password': '12345',
        'rolesId': [1]
    })
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
         
    

Active/Inactive a user

        
fetch('https://fakegundamwikiapi.onrender.com/api/users/1', {
  method: 'DELETE',
headers: {
    'Authorization': 'Bearer YOUR_TOKEN_HERE',
    'Content-Type': 'application/json'
  }
});