iconsbotsringcentralglip

How to update a Glip chatbot's name or avatar icon after it's been added to a team?


I have created and added my Glip bot to my Glip team, during which time the icon and name was chosen.

In Glip, I can change my own icon and name by clicking on the profile, but I cannot modify the bot's profile.

I was wondering if I can update the icon or the bot name after it's been added?


Solution

  • Both the bot name and bot icon in Glip can be updated via the Update Extension API using the bot's access token if the bot app has the EditExtensions permission.

    Update Bot Name via Update Extension API

    The Update Extension Info API can be used by the bot to update the bot's name in Glip if the bot has the EditExtensions app permission. The bot's name in Glip will be updated to reflect this in real-time.

    This is an example HTTP request.

    PUT /restapi/v1.0/account/~/extension/~
    Authorization: Bearer <botAccessToken>
    Content-Type: application/json
    
    {
      "contact": {
        "firstName": "Mr.",
        "lastName": "Bot"
      }
    }
    

    More info is available here:

    API Reference: https://developers.ringcentral.com/api-docs/latest/index.html#!#RefGetExtensionInfo

    Update Bot Icon via Upload User Profile Image API

    The bot icon in Glip can be updated using the Upload User Profile Image API, which also requires the EditExtensions application permission. Like the bot name, the bot icon will be updated in Glip in real-time.

    Here is a sample request.

    POST /restapi/v1.0/account/~/extension/~/profile-image
    Authorization: Bearer <botAccessToken>
    Content-Type: multipart/form-data;boundary=Boundary_1234567890
    
    --Boundary_1234567890
    Content-Disposition: form-data; name="image"; filename="icon.jpg"
    Content-Transfer-Encoding: base64
    Content-Type: image/jpeg
    
    JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAg
    [...]
    ZWYKMjQ0MjcKJSVFT0YK
    
    --Boundary_1234567890--
    

    Here is an example using curl. Of note, it's necessary to explicitly state the file content type, e.g. type=image/jpeg below.

    $ curl -v -H "Authorization: Bearer <botAccessToken>" \
    -F "image=@bot_icon.jpg;type=image/jpeg" \
    "https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/profile-image"
    

    More info is available on this API here:

    API Reference: https://developers.ringcentral.com/api-docs/latest/index.html#!#RefCreateExtensionProfileImage