update_profile_background_image not updating the bg image


#1

Hi,

I’ve tried to update the profile background image using https://dev.twitter.com/docs/api/1.1/post/account/update_profile_background_image. The API returns 200 as status code but the BG image is not updated. I’m using https://github.com/themattharris/tmhOAuth library for API calls.

And the the documentation says, we could use any of the arguments, but when I try only ‘use’ parameter, API returns error saying ‘image’ param is missing.

my code as follows:

$tmhOAuth	=	new tmhOAuth(
									[
										'consumer_key'    => 'consumer_key',
										'consumer_secret' => 'consumer_secret',
										'user_token'      => 'user_token',
										'user_secret'     => 'user_secret'
									]
								);

$params = [
			'image' => '@'.DOC_ROOT.'/assets/img/location_1.png;type=image/png;filename=location_1.png',
			'use'	=>	'true'
		];
		
$code = $tmhOAuth->request('POST', $tmhOAuth->url("1.1/account/update_profile_background_image.json"),
					$params,
					true, // use auth
					true  // multipart
				);

Help me to fix the issue.

Thanks,