- Core API's
- >
- Photos API Documentation
Photos API Documentation
A Simple to use CRUD API for your Photos application. This API is ready to use with any frontend/backend framework or language.
Endpoints
Name | Endpoint | Method | Copy |
---|---|---|---|
Photo List | /api/photos | GET | |
Photo Detail | /api/photos/1 | GET | |
Photo Create | /api/photos | POST | |
Photo Update | /api/photos/1 | PUT | |
Photo Delete | /api/photos/1 | DELETE |
How to Use
Photo List API
fetch('https://simplecrudapi.com/api/photos')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
Photo Detail API
fetch('https://simplecrudapi.com/api/photos/1')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
Photo Create API
fetch('https://simplecrudapi.com/api/photos', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'Beautiful Sunset',
description: 'A stunning view of the sunset over the mountains.',
url: 'https://via.placeholder.com/640x480.png/006644?text=enim'
})
})
.then(response => response.json())
.then(json => console.log(json))
.catch(error => console.error(error));
Photo Update API
fetch('https://simplecrudapi.com/api/photos/1', {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'Updated Sunset Photo',
description: 'A beautiful updated sunset view.',
url: 'https://via.placeholder.com/640x480.png/006644?text=sunset'
})
})
.then(response => response.json())
.then(json => console.log(json))
.catch(error => console.error(error));
Photo Delete API
fetch('https://simplecrudapi.com/api/photos/1', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(json => console.log(json))
.catch(error => console.error(error));
Code Sandbox Demos
No Code sandbox demos found yet!
No demos found, You can create a demo and contact us to put that with your credit link.
Contact UsOr,
Browse All Code sandbox Demos