Api::V1::UsersController API

Users

Update user

PATCH /api/v1/users/:id

Parameters

Name Description
id id
token token
user[first_name] First name
user[last_name] Last name
user[email] Email
user[sms_code] SMS code
user[phone] Phone
user[avatar_key] Avatar key
user[about] About
user[goal] offer_help, ask_for_help, organization
user[interests] Interests

Request

Headers

Content-Type: application/json
Host: example.org
Cookie: 

Route

PATCH /api/v1/users/181

Body

{"token":"foobar179","user":{"first_name":"foo","interests":["sport"]}}

Response

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,POST,PUT,PATCH,DELETE
Access-Control-Allow-Headers: Origin,Accept,Content-Type,X-Requested-With,X-CSRF-Token,X-API-KEY
Content-Type: application/json; charset=utf-8
ETag: W/"ab4eb25446df11131a4dbfdd4431946a"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 5fd75406-3122-473d-8664-1658462ccd4d
X-Runtime: 0.035574
Content-Length: 1045

Status

200 OK

Body

{
  "user": {
    "id": 181,
    "display_name": "Foo D.",
    "first_name": "foo",
    "last_name": "Doe",
    "roles": [

    ],
    "about": null,
    "avatar_url": null,
    "user_type": "pro",
    "partner": null,
    "engaged": false,
    "unread_count": 0,
    "permissions": {
      "outing": {
        "creation": false
      }
    },
    "interests": [
      "sport"
    ],
    "memberships": [

    ],
    "conversation": {
      "uuid": "1_list_181"
    },
    "anonymous": false,
    "uuid": "181",
    "feature_flags": {
      "organization_admin": false
    },
    "token": "foobar179",
    "email": "user179@mail.com",
    "has_password": false,
    "firebase_properties": {
      "ActionZoneDep": "not_set",
      "ActionZoneCP": "not_set",
      "Goal": "no_set",
      "Interests": "sport"
    },
    "goal": null,
    "phone": "+33600000179",
    "travel_distance": 10,
    "birthday": null,
    "stats": {
      "tour_count": 0,
      "encounter_count": 0,
      "entourage_count": 0,
      "actions_count": 0,
      "ask_for_help_creation_count": 0,
      "contribution_creation_count": 0,
      "events_count": 0,
      "good_waves_participation": false
    },
    "organization": {
      "name": "Association 84",
      "description": "Association description",
      "phone": "+33600000084",
      "address": "84 avenue des Champs Elysées 75008 Paris France",
      "logo_url": null
    },
    "address": null,
    "address_2": null
  }
}