Informazioni utente_field incomplete - documentazione API

create user field

I see

{
  "user_field[name]": "string",
  "user_field[description]": "string",
  "user_field[field_type": "string",
  "user_field[required]": true
}

Are you sure ?

I think it should be something like

{
  "user_field: {
     "name": "asdf",
     "description": "asdf",
     "field_type": "confirm",
     "required": true
  }
}

I believe that @blake wrote that documentation so let’s see what he reckons here.

Yes, if you are using Content-Type: application/json you should send it in like

The example in the api docs is using Content-Type: multipart/form-data, but I’ll be sure to update it to the json example.

2 Mi Piace

Screen Shot 2020-08-20 at 15.48.17

Thank you @blake

Note:
The problem is … i see application/json in the example (so that’s why my partner spent all hours to figure it out how to use this call)

2 Mi Piace

Ho anche lottato per circa 24 ore di fila con questo, poiché l’esempio nella documentazione suggerisce che le richieste formattate come application/json per la creazione di un nuovo utente debbano essere booleane per user_field

Mi veniva detto che non avevo completato tutti i campi utente richiesti… ma nel mio caso ho un user_field esistente e richiesto in cui devo inserire dati e dovrebbe essere formattato in questo modo:

{
  "name": "Full Name",
  "email": "email@address.com",
  "password": "348hqpwfaed",
  "username": "UserName",
  "user_fields": {
    "1": "Required User Field Data"
  }
}

La formattazione sopra ha funzionato per me.

La documentazione è corretta in questo caso per la creazione di un nuovo utente?

1 Mi Piace

No, quello era ancora il formato form-data. L’ho aggiornato per utilizzare json in modo che l’esempio corrisponda al formato. Grazie per averlo segnalato!

2 Mi Piace