Skip to main content

Issue with PUT'ing to people via API with PHP

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

How would you tag this suggestion?
Please check your e-mail for a link to activate your account.