Set Avatar Image via API

Set Avatar Image via API



Set Avatar Image via API.



Introduction

Welcome, this is a tutorial to set avatar image via API.



Uploading a file.

Arguments:

URL
Require Authentication
Method HTTP
/api/v1/users.setAvatar
yes

POST


Payloads

Arguments
Example
Required
Description
image

Any image file


Required

The image file to be used as the new avatar, as form data.


userId ou username


BsNr28znDkG8aeo7W


Optional

The user id or username. If not provided, the auth user will be updated.




Call Example



  1. curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: aobEdbYhXfu5hkeqG" \
     -F "image=@my-own-avatar.png" \

Resultado:
  1. {

    "success" : true
    }

Providing a URL

Arguments:


Argument
Example
Required
Description

avatarUrl


Required


URL of the new avatar for the user.


userId ou username


BsNr28znDkG8aeo7W

Optional


The user id or username. If not provided, the auth user will be updated.



Call Example

  1. curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
    -H "X-User-Id: aobEdbYhXfu5hkeqG" \
    -H "Content-type: application / json" \
    -d '{"avatarUrl": "http: //domain.tld/to/my/own/avatar.jpg"}' \
    https://<meuescritorio>.myhive.global/api/v1/users.setAvatar


Example result:
  1. {

    "result" :  true
    }
In case of doubts or suggestions, please contact our support via e-mail: suportebr@myhive.global

    • Related Articles

    • Set status via API

      Set status via API. Introduction Welcome, this is a tutorial to help set status via API. Defines a user status when status message and status are provided. Arguments: URL Require Authentication Method HTTP /api/v1/users.setAvatar yes POST  Payloads ...
    • Paging via API

      Paging via API. Introduction Welcome, this is a tutorial to help understand how to count, offset, sort via API. As of version, some of the endpoints support query parameters, and . However, the defaults are different by server due to configuration ...
    • Disable users via API.

      Disable users via API. Introduction Welcome, this is a tutorial to disable user via API. Note: Disable inactive users. Permission required:    edit-other-user-active-status. Parameters URL Require Authentication Method HTTP ...
    • Translate message via API

      Translate message via API. Introduction Welcome, this is a tutorial to translate a message via API. Translate the message provided. Arguments URL Require Authentication Método HTTP /api/v1/autotranslate.translateMessage yes POST  Payloads Argument ...
    • Creating user via API.

      Creating user via API. Introduction Welcome, this is a tutorial to login via API Parameters URL Require Authentication Method HTTP /api/v1/users.create yes POST Variables Note: To save customFields, you must first define customFields in the admin ...