05-01-2024 11:47 PM
I'm encountering an issue with an API call in my application that integrates with Meta platforms. Below is the code snippet causing the error:
Code Causing Error: 👇
fetch('https://graph.facebook.com/v12.0/{user-id}/feed', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer {access token}'
},
body: JSON.stringify({
message: 'Hello, world!'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));