Update a share

PUT /accounts/{account_id}/alerts/{alert_id}/shares/{share_id}

Updates an existing share, usually in order to modify rights associated to the user, or to block a user from access to this alert.

Parameters

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

Minimal curl example

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

As you see in the curl example, there is no minimal requirement in the PUT request in terms of attributes sent. Therefore, you can modify only a single parameter if you wish to.


Available properties

Modifiable attributes are different from those of the POST request, but not only:

Properties _ Definition Example
blocked optional Indicates that the account is blocked on that alert false

Account id

account_id

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

Blocked

blocked

Boolean value indicating that you want to block the user from that alert.


Request example

  • Headers
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept-Version: 1.19
  • Body
{
    "blocked": true,
}

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": true,
    "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.