- Core API's
- >
- Tags API
- >
- Tags - Create
Tags - Create API
Create a new Tag.
Method POST
Body
{
"name": "Sample Tag",
"description": "This is a sample tag description."
}
How to Use
fetch('https://simplecrudapi.com/api/tags', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Education',
description: 'Sample Tag for Education'
})
})
.then(response => response.json())
.then(json => console.log(json))
.catch(error => console.error('Error posting data:', error));
Response
{
"data": {
"id": 1,
"name": "Education",
"description": "Sample Tag for Education"
}
}
Try Now
fetch('https://simplecrudapi.com/api/tags', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Education',
description: 'Sample Tag for Education'
})
})
.then(response => response.json())
.then(json => console.log(json))
.catch(error => console.error('Error posting data:', error));