Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues passing data into Create call #1

Open
jackroscoe opened this issue Oct 24, 2016 · 0 comments
Open

Issues passing data into Create call #1

jackroscoe opened this issue Oct 24, 2016 · 0 comments

Comments

@jackroscoe
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant