Broadcast message to social media


#1

I am attempting to create a broadcast message as a draft through the api. I am getting an internal error, but not any great indication of what could be causing this.

Example Code and Response: http://bbrock25-share.s3.amazonaws.com/lHpDmQQj.png

API Documentation: https://developers.hubspot.com/docs/methods/social_media/create_broadcast


#2

Hi @Bill_Brock,

I'm not particularly familiar with the python requests library, but is the json=body syntax setting the request's Content-type header to application/json? I'm wondering if that header isn't being explicitly set, which is causing this error.

If that's not the case here, could you reach back out here with your Hub ID so that I can take a closer look?


#3

Yes it should be setting that header correctly. Is my Hub ID safe to share here? ie: does it matter if its leaked?


#4

Sent it to you in a message.

I also tested this in postman with similar results.


#5

Hi @Bill_Brock,

You Hub ID isn't really sensitive, but it's fine to direct message it if you'd rather not post it on a forum post. I did some testing, and I was able to create an example draft message in your portal (check out the drafts in your portal). This leads me to believe it's related to the content of your request. Is it possible that:

  1. The headers (specifically Content-type) aren't being set properly?
  2. The CHANNEL_GUID variable is empty/malformed?

Also, can you post the raw text of the request you made in postman?


#6

I updated the channel GUID and it seems to be working now. Do these stay constant or do they change/cycle over time?


#7

Hi @Bill_Brock,

That's actually a good question. I believe they're static, but re-authenticating accounts will reset them. I'll touch base with my team for a more explicit answer to that question.