Hi,
We're using the NB people API with PHP and the adoy/oauth2 library. Recently, whenever our site makes a PUT to /api/v1/people/push, we seem to be receiving a code 400 error with no message attached.
Code:
$payload = array(
'person' => array(
'first_name' => $first_name,
'last_name' => $last_name,
'email' => $email,
'note' => 'Sign up from web form at ' . DB::now(),
'email_opt_in' => true
)
);
$api_url = $baseApiUrl . '/api/v1/people/push';
$response = $client->fetch($api_url, $payload, 'PUT', array('Content-type' => 'application/json', 'Accept' => 'application/json'));
The response comes through like this:
(
[result] =>
[code] => 400
[content_type] => text/plain; charset=utf-8
)
Can anyone point me in the direction of what isn't right here?
Thanks,
Sam
Showing 5 reactions
Sign in with
$client->setAccessTokenType(OAuth2\Client::ACCESS_TOKEN_BEARER);
Array ( [result] => [code] => 406 [content_type] => text/html; charset=utf-8 )