# Share Content

## PROVISIONAL -  Share a piece of content into Symphony

> Given a 3rd party content (eg. news article), it can share to the given stream.\
> The stream can be a chatroom, an IM or a multiparty IM.<br>

```json
{"openapi":"3.0.1","info":{"title":"Agent API","version":"25.8.1"},"servers":[{"url":"youragentURL.symphony.com/agent"}],"paths":{"/v3/stream/{sid}/share":{"post":{"tags":["Share"],"summary":"PROVISIONAL -  Share a piece of content into Symphony","description":"Given a 3rd party content (eg. news article), it can share to the given stream.\nThe stream can be a chatroom, an IM or a multiparty IM.\n","parameters":[{"name":"sid","in":"path","description":"Stream ID","required":true,"schema":{"type":"string"}},{"name":"sessionToken","in":"header","description":"Session authentication token.","required":true,"schema":{"type":"string"}},{"name":"keyManagerToken","in":"header","description":"Key Manager authentication token.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareContent"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V2Message"}}}},"400":{"description":"Client error, see response body for further details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized: Session tokens invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: Caller lacks necessary entitlement.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error, see response body for further details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"ShareContent":{"type":"object","properties":{"type":{"type":"string","description":"Type of content to be shared.  Currently only support \"com.symphony.sharing.article\""},"content":{"$ref":"#/components/schemas/ShareArticle"}}},"ShareArticle":{"required":["appId","author","publisher","title"],"type":"object","properties":{"articleId":{"type":"string","description":"An ID for this article that should be unique to the calling application. \nEither an articleId or an articleUrl is required.\n"},"title":{"type":"string","description":"The title of the article"},"subTitle":{"type":"string","description":"The subtitle of the article"},"message":{"type":"string","description":"The message text that can be send along with the shared article"},"publisher":{"type":"string","description":"Publisher of the article"},"publishDate":{"type":"integer","description":"Article publish date in unix timestamp","format":"int64"},"thumbnailUrl":{"type":"string","description":"Url to the thumbnail image"},"author":{"type":"string","description":"Author of the article"},"articleUrl":{"type":"string","description":"Url to the article"},"summary":{"type":"string","description":"Preview summary of the article"},"appId":{"type":"string","description":"App ID of the calling application"},"appName":{"type":"string","description":"App name of the calling application"},"appIconUrl":{"type":"string","description":"App icon url of the calling application"}}},"V2Message":{"description":"A representation of a message sent by a user of Symphony.","allOf":[{"$ref":"#/components/schemas/V2BaseMessage"},{"required":["fromUserId","message"],"type":"object","properties":{"message":{"type":"string","description":"Message text in MessageML","format":"MessageML"},"fromUserId":{"type":"integer","description":"the Symphony userId of the user who sent the message. This will be populated by the server (and actually ignored if included when sending a message).","format":"int64"},"attachments":{"type":"array","default":[],"items":{"$ref":"#/components/schemas/AttachmentInfo"}}}}]},"V2BaseMessage":{"required":["streamId","timestamp","v2messageType"],"type":"object","properties":{"id":{"type":"string","description":"The messageId is assigned by the ingestor service when a message is sent."},"timestamp":{"type":"string"},"v2messageType":{"type":"string"},"streamId":{"type":"string"}},"discriminator":{"propertyName":"v2messageType"}},"AttachmentInfo":{"required":["id","name","size"],"type":"object","properties":{"id":{"type":"string","description":"The attachment ID."},"name":{"type":"string","description":"The file name."},"size":{"type":"integer","description":"Size in bytes.","format":"int64"}}},"Error":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}}}}
```

### Request Example

```url
curl -X POST \
https://acme.symphony.com/agent/v3/stream/7w68A8sAG_qv1GwVc9ODzX___ql_RJ6zdA/share \
-H "sessionToken: SESSION_TOKEN" \
-H "keyManagerToken: KEY_MANAGER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
   "type": "com.symphony.sharing.article",
   "content":{
        "articleId":"tsla",
        "title": "The Secret'"'"'s Out: Tesla Enters China and Is Winning",
        "description": "Check this out",
        "publisher": "Capital Market Laboratories",
        "thumbnailUrl": "http://www.cmlviz.com/cmld3b/images/tesla-supercharger-stop.jpg",
        "author": "OPHIRGOTTLIEB",
        "articleUrl": "http://ophirgottlieb.tumblr.com/post/146623530819/the-secrets-out-tesla-enters-china-and-is",
        "summary": "Tesla Motors Inc. (NASDAQ:TSLA) has a CEO more famous than the firm itself, perhaps. Elon Musk has made some bold predictions, first stating that the firm would grow sales from 50,000 units in 2015 to 500,000 by 2020 powered by the less expensive Model 3 and the massive manufacturing capability of the Gigafactory.",
        "appId": "ticker",
        "appName": "Market Data Demo",
        "appIconUrl": "https://apps-dev.symphony.com/ticker/assets/images/logo.png"
    }
}'
```

> #### 📘 Note
>
> Visit [Overview](https://docs.developers.symphony.com/building-bots-on-symphony/datafeed/overview-of-streams) for an overview of streams.

> #### 🚧 Roles and Privileges
>
> For not public rooms, the caller needs to be on the stream or have the Content Management role.\
> See [Bot Permissions](https://docs.developers.symphony.com/building-bots-on-symphony/configuration/bot-permissions) for a list of roles and associated privileges.

### Content Fields

<table><thead><tr><th width="179">Parameter</th><th width="85">Type</th><th width="140">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>articleId</code></td><td>string</td><td>Yes, if <code>articleUrl</code> not specified</td><td>A unique ID for this article, not used by any other article</td></tr><tr><td><code>title</code></td><td>string</td><td>Yes</td><td>The title of the article</td></tr><tr><td><code>subTitle</code></td><td>string</td><td>No</td><td>The subtitle of the article</td></tr><tr><td><code>message</code></td><td>string</td><td>No</td><td>The message text that can be sent along with the shared article</td></tr><tr><td><code>publisher</code></td><td>string</td><td>Yes</td><td>Publisher of the article</td></tr><tr><td><code>publishDate</code></td><td>string</td><td>No</td><td>Article publish date in unix timestamp (in seconds)</td></tr><tr><td><code>thumbnailUrl</code></td><td>string</td><td>No</td><td>URL to the thumbnail image</td></tr><tr><td><code>author</code></td><td>string</td><td>Yes</td><td>Author of the article</td></tr><tr><td><code>articleUrl</code></td><td>string</td><td>Yes, if <code>articleId</code> not specified</td><td>URL to the article</td></tr><tr><td><code>summary</code></td><td>string</td><td>No</td><td>Preview summary of the article</td></tr><tr><td><code>appId</code></td><td>string</td><td>Yes</td><td>App ID of the calling application</td></tr><tr><td><code>appName</code></td><td>string</td><td>No</td><td>App name of the calling application</td></tr><tr><td><code>appIconUrl</code></td><td>string</td><td>No</td><td>App icon URL of the calling application</td></tr></tbody></table>
