API POST Global Announcement to Specific Roles using Postman

Jump to solution
thomas_bishop
Community Explorer

I am having trouble formatting a value array in Postman to post a Global Announcement to specific roles using the "account_notification_roles" as referenced in the Create a Global Announcement API. The documentation doesn't give much of an example and I've tried several ways to enter both the key and the value into the Postman Params tab. It either posts the announcement to everybody and doesn't pick up on the roles, or it generates an error. Here is a screen shot from Postman of my latest attempt. Each time it creates an announcement, the "role_ids" and "roles" response come back empty. Does anyone know the right combination/syntax that will work in this case? Thanks in advance.
Postman-GlobalAnnouncement-roles.PNG

Edit: I was able to upload the screen shot.

0 Likes
1 Solution
jerry_nguyen
Community Contributor

@thomas_bishop 

This is how you set it with Postman. If you want to add more roles you will need to add another account_notification_roles[] key to the list of params.

PostAnnouncement_Postman.JPG

Alternatively, you can use @James 's JSON and put it under "Body" -> "Raw" and change type from Text to JSON

PostAnnouncement_RawJSON.JPG

In your future posts, I would suggest you insert your image directly by uploading it from your computer rather than embedding a link from google drive

 

View solution in original post