{"action":"created","issue":{"url":"https://api.github.com/repos/restfb/restfb/issues/332","labels_url":"https://api.github.com/repos/restfb/restfb/issues/332/labels{/name}","comments_url":"https://api.github.com/repos/restfb/restfb/issues/332/comments","events_url":"https://api.github.com/repos/restfb/restfb/issues/332/events","html_url":"https://github.com/restfb/restfb/issues/332","id":118135120,"number":332,"title":"Uploading an AdImage","user":{"login":"EZWrighter","id":466883,"avatar_url":"https://avatars.githubusercontent.com/u/466883?v=3","gravatar_id":"","url":"https://api.github.com/users/EZWrighter","html_url":"https://github.com/EZWrighter","followers_url":"https://api.github.com/users/EZWrighter/followers","following_url":"https://api.github.com/users/EZWrighter/following{/other_user}","gists_url":"https://api.github.com/users/EZWrighter/gists{/gist_id}","starred_url":"https://api.github.com/users/EZWrighter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EZWrighter/subscriptions","organizations_url":"https://api.github.com/users/EZWrighter/orgs","repos_url":"https://api.github.com/users/EZWrighter/repos","events_url":"https://api.github.com/users/EZWrighter/events{/privacy}","received_events_url":"https://api.github.com/users/EZWrighter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-20T22:00:17Z","updated_at":"2015-11-20T23:00:39Z","closed_at":null,"body":"Failure when attempting to upload an image to an AdAccount.  I did not see any specific documentation on this @ restfb, but thought it might be possible by using the client publish method of restfb.\r\n\r\nhttps://developers.facebook.com/docs/marketing-api/reference/ad-image#Creating\r\n\r\nI attempted a couple different routes to try and complete this.  Initially I attempted a zipbytes parameter with the publish method:\r\n\r\nGraphResponse response = facebookClient.publish(\"/{AdAccountId}/adimages\", GraphResponse.class,\t\t\t\tParameter.with(\"zipbytes\", new String(zipBytes, \"UTF-8\")));\r\n\r\nWhich threw NO exceptions, but returned a GraphResponse with isSuccess() == false and the file was NOT added to the Ad Account.\r\n\r\nThen I attempted with \"bytes\" parameter\r\n\r\nGraphResponse response = facebookClient.publish(\"/{AdAccountId}/adimages\", GraphResponse.class,\r\n\t\t\t\t  Parameter.with(\"bytes\", new String(fileBytes, \"UTF-8\")));\r\n\r\nand received an exception: Received Facebook error response of type FacebookApiException: Invalid parameter (code 100, subcode 1487242)\r\n\r\nAm I doing this all wrong?  Is this even possible with the current code base?  I did successfully upload a video to the ad account, so I couldn't image that this would be a more difficult process :-)\r\n\r\nThanks for any pointers.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/restfb/restfb/issues/comments/158551570","html_url":"https://github.com/restfb/restfb/issues/332#issuecomment-158551570","issue_url":"https://api.github.com/repos/restfb/restfb/issues/332","id":158551570,"user":{"login":"EZWrighter","id":466883,"avatar_url":"https://avatars.githubusercontent.com/u/466883?v=3","gravatar_id":"","url":"https://api.github.com/users/EZWrighter","html_url":"https://github.com/EZWrighter","followers_url":"https://api.github.com/users/EZWrighter/followers","following_url":"https://api.github.com/users/EZWrighter/following{/other_user}","gists_url":"https://api.github.com/users/EZWrighter/gists{/gist_id}","starred_url":"https://api.github.com/users/EZWrighter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EZWrighter/subscriptions","organizations_url":"https://api.github.com/users/EZWrighter/orgs","repos_url":"https://api.github.com/users/EZWrighter/repos","events_url":"https://api.github.com/users/EZWrighter/events{/privacy}","received_events_url":"https://api.github.com/users/EZWrighter/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T23:00:39Z","updated_at":"2015-11-20T23:00:39Z","body":"Thanks for the fast response.\r\n\r\n> Can you please try the \"NO exception\" case again and let the Response be a JsonObject instead of the GraphResponse\r\n\r\nI did this and the JSON response was an empty json object \"{}\"\r\n\r\nI also tried the call with a Binary Attachment:\r\n\r\n```Java\r\nJsonObject response = facebookClient.publish(\"/{AdAccountId}/adimages\", JsonObject.class,\r\n\t\t\t\t  BinaryAttachment.with(\"bytes\", fileBytes));\r\n```\r\n\r\nand receive an Exception:  `FacebookApiException: Invalid parameter (code 100, subcode 1487411)`\r\n\r\nAppreciate the help.\r\n\r\n\r\n"}}