Characters
Get all characters
fetch('https://fakegundamwikiapi.onrender.com/api/characters', {
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));
[
{
"characterId": 1,
"characterName": "Amuro Ray",
"characterAliases": "The White Devil",
"characterClassification": "Newtype",
"characterBirthDate": "November 4,0063",
"characterGenderId": 2,
"affiliations": [
{
"affiliationId": 1,
"affiliationName": "Earth Federation Forces",
"affiliationPurpose": "Military Organization",
"isActive": true,
"created": "2024-02-11T16:49:02.0024956",
"createdBy": null,
"lastModified": "2024-02-11T16:49:02.0027397",
"lastModifiedBy": null
},
{
"affiliationId": 2,
"affiliationName": "Karaba",
"affiliationPurpose": "Resistance movement",
"isActive": true,
"created": "2024-02-11T16:50:01.1771117",
"createdBy": null,
"lastModified": "2024-02-11T16:50:01.1771201",
"lastModifiedBy": null
},
{
"affiliationId": 3,
"affiliationName": "Londo Bell",
"affiliationPurpose": "Special Operations Forces",
"isActive": true,
"created": "2024-02-11T16:50:31.1738626",
"createdBy": null,
"lastModified": "2024-02-11T16:50:31.1738749",
"lastModifiedBy": null
}
],
"isActive": true,
"created": "2024-02-11T16:52:17.3530024",
"createdBy": null,
"lastModified": "2024-02-11T16:52:17.3530225",
"lastModifiedBy": null
}
]
Get a single character
fetch('https://fakegundamwikiapi.onrender.com/api/characters/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));
{
"characterId": 1,
"characterName": "Amuro Ray",
"characterAliases": "The White Devil",
"characterClassification": "Newtype",
"characterBirthDate": "November 4,0063",
"characterGenderId": 2,
"affiliations": [
{
"affiliationId": 1,
"affiliationName": "Earth Federation Forces",
"affiliationPurpose": "Military Organization",
"isActive": true,
"created": "2024-02-11T16:49:02.0024956",
"createdBy": null,
"lastModified": "2024-02-11T16:49:02.0027397",
"lastModifiedBy": null
},
{
"affiliationId": 2,
"affiliationName": "Karaba",
"affiliationPurpose": "Resistance movement",
"isActive": true,
"created": "2024-02-11T16:50:01.1771117",
"createdBy": null,
"lastModified": "2024-02-11T16:50:01.1771201",
"lastModifiedBy": null
},
{
"affiliationId": 3,
"affiliationName": "Londo Bell",
"affiliationPurpose": "Special Operations Forces",
"isActive": true,
"created": "2024-02-11T16:50:31.1738626",
"createdBy": null,
"lastModified": "2024-02-11T16:50:31.1738749",
"lastModifiedBy": null
}
],
"isActive": true,
"created": "2024-02-11T16:52:17.3530024",
"createdBy": null,
"lastModified": "2024-02-11T16:52:17.3530225",
"lastModifiedBy": null
}
Create a new character
fetch('https://fakegundamwikiapi.onrender.com/api/characters', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'characterName': 'Earth Federation Forces',
'charactersAliases': 'Military Organization',
'characterClassification' : '',
'characterBirthDate': '',
'characterGenderId': '',
'affiliationIds' : []
})
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
{
"characterId": 1,
"characterName": "Amuro Ray",
"characterAliases": "The White Devil",
"characterClassification": "Newtype",
"characterBirthDate": "November 4,0063",
"characterGenderId": 2,
"affiliations": [
{
"affiliationId": 1,
"affiliationName": "Earth Federation Forces",
"affiliationPurpose": "Military Organization",
"isActive": true,
"created": "2024-02-11T16:49:02.0024956",
"createdBy": null,
"lastModified": "2024-02-11T16:49:02.0027397",
"lastModifiedBy": null
},
{
"affiliationId": 2,
"affiliationName": "Karaba",
"affiliationPurpose": "Resistance movement",
"isActive": true,
"created": "2024-02-11T16:50:01.1771117",
"createdBy": null,
"lastModified": "2024-02-11T16:50:01.1771201",
"lastModifiedBy": null
},
{
"affiliationId": 3,
"affiliationName": "Londo Bell",
"affiliationPurpose": "Special Operations Forces",
"isActive": true,
"created": "2024-02-11T16:50:31.1738626",
"createdBy": null,
"lastModified": "2024-02-11T16:50:31.1738749",
"lastModifiedBy": null
}
],
"isActive": true,
"created": "2024-02-11T16:52:17.3530024",
"createdBy": null,
"lastModified": "2024-02-11T16:52:17.3530225",
"lastModifiedBy": null
}
Update a character
fetch('https://fakegundamwikiapi.onrender.com/api/characters/1', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'characterId':1,
'characterName': 'Earth Federation Forces',
'charactersAliases': 'Military Organization',
'characterClassification' : '',
'characterBirthDate': '',
'characterGenderId': '',
'affiliationIds' : []
})
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
{
"characterId": 1,
"characterName": "Amuro Ray",
"characterAliases": "The White Devil",
"characterClassification": "Newtype",
"characterBirthDate": "November 4,0063",
"characterGenderId": 2,
"affiliations": [
{
"affiliationId": 1,
"affiliationName": "Earth Federation Forces",
"affiliationPurpose": "Military Organization",
"isActive": true,
"created": "2024-02-11T16:49:02.0024956",
"createdBy": null,
"lastModified": "2024-02-11T16:49:02.0027397",
"lastModifiedBy": null
},
{
"affiliationId": 2,
"affiliationName": "Karaba",
"affiliationPurpose": "Resistance movement",
"isActive": true,
"created": "2024-02-11T16:50:01.1771117",
"createdBy": null,
"lastModified": "2024-02-11T16:50:01.1771201",
"lastModifiedBy": null
},
{
"affiliationId": 3,
"affiliationName": "Londo Bell",
"affiliationPurpose": "Special Operations Forces",
"isActive": true,
"created": "2024-02-11T16:50:31.1738626",
"createdBy": null,
"lastModified": "2024-02-11T16:50:31.1738749",
"lastModifiedBy": null
}
],
"isActive": true,
"created": "2024-02-11T16:52:17.3530024",
"createdBy": null,
"lastModified": "2024-02-11T16:52:17.3530225",
"lastModifiedBy": null
}
Active/Inactive a character
fetch('https://fakegundamwikiapi.onrender.com/api/characters/1', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
});;