Social publishing API


#1

Hi,
Now Im working on a new integration app and wandering how I can create a new Social Post with an image attachment using your API (just like in general UI in Social - Publishing portal section).
Ive found the endpoint http://developers.hubspot.com/docs/methods/social_media/create_broadcast but it seems that POST /broadcast/v1/broadcasts method is for sharing content and not for creating own social posts. So how can I create my own social post (with text and image attachment)?

Thanks!


#2

Hi @Ragnar

You can include an image in the post by using the imageUrl property in the content of the post.

"content": {
  "imageUrl": "https://domain.com/path/to/image.jgp",
  "body": "Huge appetite for investment in Africa's renewable energy projects\nhttp://hubs.ly/H01f_TY0",
}

#3

Great! Thanks for your help.


#4

Hi again!
Trying to use imageUrl param to include an image in post but with no luck. Just body param is works for text. I.e.:

{ "content": { "body": "Eat What You Want Day", "imageUrl": "http://thumb9.shutterstock.com/photos/display_pic_with_logo/247744/144532082.jpg" }, "triggerAt": 1472054400000, "channelGuid": "xxxx" }

Just “Eat What You Want Day” text appears in resulting post.


#5

Are you not seeing the image when viewing the post in HubSpot? Or is it not showing up on the social media site after it publishes? By default, posts created through the API suppress the preview, since the full preview would need to be populated manually through the API as well, so you wouldn’t see the image in HubSpot even if the image shows up on the site after it publishes.


#6

I cant see an image on social sites after publishing. And how can I populate full preview through the API?


#7

You’d need to set linkPreviewSuppressed in the content to false, along with populating the other items in the content data. The full list of the JSON properties you’d need to add in content is here:

"content": {
  "linkPreviewSuppressed": "false",
  "imageUrl": "http://cdn1.hubspot.com/hub/62515/image.png",
  "originalLink": "http://example.com/shared-page",
  "description": "This is usually the meta description, but you can change it",
  "body": "http://example.com/shared-page This is the post body.",
  "title": "This is usually the page title, but you can change it"
}

#8

Ok, this post structure is not works for me but your API error messages gives some useful info. Param “photoUrl” is works and I see attached image.


#9

Hello ,

I have created a social post with a link to article for Facebook through the API but for some reason when it gets pushed it does not show the link preview it just shows the raw link, is there an attribute I can send the will force the link to show as a preview on Facebook

Thanks