Vote count:
0
We would like to creat an video ad, and we followed the instrution of page
http://ift.tt/1AumMDm
Request:
http://ift.tt/1whBusf
We uploaded an mp4 video and got:
{"error":{"message":"An access token is required to request this resource.","type":"OAuthException","code":104}}
Our code:
String token = "";
String accountId="";
String fileName = "11.mp4";
DefaultFacebookClient defaultFacebookClient = new DefaultFacebookClient(token, new DefaultWebRequestor(), new DefaultJsonMapper(), Version.Version_2_2);
InputStream input = this.getClass().getClassLoader().getResourceAsStream(fileName);
byte[] byt = new byte[input.available()];
input.read(byt);
BinaryAttachment body = BinaryAttachment.with("source", byt);
String publish = defaultFacebookClient.publish("act_"+accountId+"/advideos", String.class, body);
//生成的url为http://ift.tt/1whBusf
System.out.println(publish);
asked 31 secs ago
facebook upload advideo code=104
Aucun commentaire:
Enregistrer un commentaire