Affiliations
Get all affiliations
fetch('https://fakegundamwikiapi.onrender.com/api/affiliations', {
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));
[
{
"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
}
]
Get a single affiliation
fetch('https://fakegundamwikiapi.onrender.com/api/affiliations/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));
"{
""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
}"
Create a new affiliation
fetch('https://fakegundamwikiapi.onrender.com/api/affiliations', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
'affiliationName': 'Earth Federation Forces',
'affiliationPurpose': 'Military Organization'
})
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));;
{
"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
}
Update a affiliation
fetch('https://fakegundamwikiapi.onrender.com/api/affiliations/1', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'affiliationId': 1,
'affiliationName': 'Earth Federation Forces',
'affiliationPurpose': 'Military Organization'
})
})
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
{
"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
}
Active/Inactive a affiliation
fetch('https://fakegundamwikiapi.onrender.com/api/affiliations/1', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
});;