Create a share

POST /accounts/{account_id}/alerts/{alert_id}/shares

Creates a new share object on the alert given as parameter. Such a share object represents the link between the account of id account_id and the alert of id alert_id.

Parameters

  • account_id (string) - Id of the account
  • alert_id (number) - Id of the alert

Page content


Minimal curl example

curl -ig 'https://api.mention.net/api/accounts/{account_id}/alerts/{alert_id}/shares' \
    -X POST \
    -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
    -H 'Content-Type: application/json' \
    -H 'Accept-Version: 1.19' \
    -d '{
        "account_id":"12345_69gjjsg4itgkcco040okwsck700o4w8gsco0k4kco0s4scw8o0"
    }'

Note that you should use an existing account id instead of "account_id":"12345_alejrz12L3J4LLkdfslje097ekr". This may be an account of someone in your team for instance.


Available properties

Properties _ Definition Example
account_id required Account id of the account with which alert is shared 12345_alejrz12L3J4LLkdfslje097ekr

Account id

account_id

the public id of the account we want to share the alert with.


Request example

  • Headers
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept-Version: 1.19
  • Body
{
    "account_id": "12345_69gjjsg4itgkcco040okwsck700o4w8gsco0k4kco0s4scw8o0"
}

Response example

If the request was successful, the response will return the full share data, just as if you did a GET request on that share.

  • Body
{
    "id": "12345_69gjjsg4itgkcco040okwsck700o4w8gsco0k4kco0s4scw8o0",
    "account": {...},
    "blocked": false,
    "permissions": {
        "edit": true,
        "delete": true
    },
    "created_at": "2016-01-19T12:43:46.0+00:00",
    "weight": 50
}

Account

account

It is a subset of the account data of the account with whom the alert is being shared. It is very similar to the data you might get by fetching the account.

Blocked

blocked

Boolean indicating if the share was blocked for this user.

Permissions

permissions

Permissions associated to the role of the user.

Weight

weight

The weight of the alert on this user's front end.