{"_id":"546be31f52812008000414af","user":"5433099f9a2b451a00ad4531","__v":2,"parentDoc":null,"category":{"_id":"546b9072b47b5d1400109edf","project":"545137a814af501a00b50cf9","version":"545137a814af501a00b50cfc","__v":6,"pages":["546bdfb555639108002b1842","546be31f52812008000414af","546be32e55639108002b184a","546be33c52812008000414b1","546be34a52812008000414b3","546be36255639108002b184c"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-11-18T18:31:14.459Z","from_sync":false,"order":4,"slug":"open-graph","title":"Open Graph"},"version":{"_id":"545137a814af501a00b50cfc","project":"545137a814af501a00b50cf9","__v":11,"createdAt":"2014-10-29T18:53:28.525Z","releaseDate":"2014-10-29T18:53:28.525Z","categories":["545137a814af501a00b50cfd","545138eaa66f020800dbab4a","546b9072b47b5d1400109edf","546b9082b47b5d1400109ee0","546b9088b47b5d1400109ee1","546b909462515a14007ebc43","546b90a0b47b5d1400109ee2","546ced235884600e007a92f6","5481008eea7fd40b00cd7c2b","573b9d83ee2b3b220042291f","57be1efa15efc70e006a5f99"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"project":"545137a814af501a00b50cf9","updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-11-19T00:23:59.650Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"try":true,"basic_auth":false,"auth":"never","params":[],"url":""},"isReference":false,"order":1,"body":"Once you have formatted your activity, the next step is to deliver this activity to the user’s Yammer network. This is done by defining the appropriate JSON payload and posting it to the API endpoint below using the Oauth access token, obtained earlier during the process authentication.\n\nPOST to:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://www.yammer.com/api/v1/activity.json\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nMake sure to set the Content-type of the request body to “application/json”.\n\nOauth access token sent as a “Bearer” token in the “Authorization” request header:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /api/v1/messages/following.json HTTP/1.1 \\nHost: www.yammer.com \\nAuthorization: Bearer abcDefGhi\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nFor more details on the “Bearer” token refer to: http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-23\n\nJSON Payload for the activity “Sidd Singh” created “Lunch Meeting” on Sched.do: Hey, let’s get sushi! :\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\\"activity\\\":{\\n\\\"actor\\\":{\\\"name\\\":\\\"Sidd Singh\\\",\\n\\\"email\\\":\\\"sidd:::at:::xyz.com\\\"},\\n\\\"action\\\":\\\"create\\\",\\n\\\"object\\\": {\\n\\\"url\\\":\\\"https://www.sched.do\\\",\\n\\\"title\\\":\\\"Lunch Meeting\\\"\\n},\\n\\\"message\\\":\\\"Hey, let’s get sushi!\\\",\\n\\\"users\\\":[\\n{\\\"name\\\":\\\"Adarsh Pandit\\\",\\n\\\"email\\\":\\\"adarsh@xyz.com\\\"}\\n]\\n}\\n}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nThis activity will appear in the Yammer Activity Stream Ticker (shown above) and will be delivered to the actor, the actor’s followers and the people specified in the “users” list, in this case to Sidd Singh, his followers and to Adarsh Pandit. The OG object of this activity “Lunch Meeting” will be searchable by any user in the actor’s Yammer network.\n\n\n**Delivery Rules**\n\nThe “private” parameter can be used to restrict the recipient list for the activity. By default this parameter is false but if set to true, the activity will only be delivered to the users included in the activity’s “users” list, as well as the actor. If “private” is set to false (or not included), the activity will be delivered to the users included in the activity’s “users” list, the actor in the story and the actor’s followers. For maximum visibility of your app activities, we recommend going with the default public model where the “private” parameter is not included.\n\nThe OG object of a public activity is searchable (and autocompletes in real time search) in Yammer by any user in the actor’s network. For a private activity, only the actor and the “users” list can view the associated OG object.","excerpt":"","slug":"delivery","type":"basic","title":"Delivery"}
Once you have formatted your activity, the next step is to deliver this activity to the user’s Yammer network. This is done by defining the appropriate JSON payload and posting it to the API endpoint below using the Oauth access token, obtained earlier during the process authentication. POST to: [block:code] { "codes": [ { "code": "https://www.yammer.com/api/v1/activity.json", "language": "text" } ] } [/block] Make sure to set the Content-type of the request body to “application/json”. Oauth access token sent as a “Bearer” token in the “Authorization” request header: [block:code] { "codes": [ { "code": "GET /api/v1/messages/following.json HTTP/1.1 \nHost: www.yammer.com \nAuthorization: Bearer abcDefGhi", "language": "text" } ] } [/block] For more details on the “Bearer” token refer to: http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-23 JSON Payload for the activity “Sidd Singh” created “Lunch Meeting” on Sched.do: Hey, let’s get sushi! : [block:code] { "codes": [ { "code": "{\n\"activity\":{\n\"actor\":{\"name\":\"Sidd Singh\",\n\"email\":\"sidd@xyz.com\"},\n\"action\":\"create\",\n\"object\": {\n\"url\":\"https://www.sched.do\",\n\"title\":\"Lunch Meeting\"\n},\n\"message\":\"Hey, let’s get sushi!\",\n\"users\":[\n{\"name\":\"Adarsh Pandit\",\n\"email\":\"adarsh@xyz.com\"}\n]\n}\n}", "language": "text" } ] } [/block] This activity will appear in the Yammer Activity Stream Ticker (shown above) and will be delivered to the actor, the actor’s followers and the people specified in the “users” list, in this case to Sidd Singh, his followers and to Adarsh Pandit. The OG object of this activity “Lunch Meeting” will be searchable by any user in the actor’s Yammer network. **Delivery Rules** The “private” parameter can be used to restrict the recipient list for the activity. By default this parameter is false but if set to true, the activity will only be delivered to the users included in the activity’s “users” list, as well as the actor. If “private” is set to false (or not included), the activity will be delivered to the users included in the activity’s “users” list, the actor in the story and the actor’s followers. For maximum visibility of your app activities, we recommend going with the default public model where the “private” parameter is not included. The OG object of a public activity is searchable (and autocompletes in real time search) in Yammer by any user in the actor’s network. For a private activity, only the actor and the “users” list can view the associated OG object.