Issues passing data into Create call
jackroscoe opened this issue · comments
Jack Roscoe commented
Hi!
I'm struggling to use the examples in the main repo to successfully create a buffer post via the API. The data doesn't appear to be getting built into the request when using the following code.
Am I misunderstanding the use of the $options array?
// Prepare options
$scheduleOptions = json_encode(
[
'profile_ids' => array(1, 2),
'text' => 'Test',
'shorten' => false,
'media' => [
'link' => 'http://test.com',
'description' => 'Test',
'title' => 'Test',
'picture' => 'https://example.com/img.jpg'
],
'scheduled_at' => $scheduleTimestamp->format(DateTime::ATOM)
]
);
// Create the request for the new post
$requestCreate = $provider->getAuthenticatedRequest(
'POST',
'https://api.bufferapp.com/1/updates/create.json',
$token,
array(
'body' => $scheduleOptions
)
);
Thanks for any help.