Custom fields

GET /api/custom_fields
get a list of custom fields defined for the current community

Success Response Code: 200

Response Fields

custom_fields array of custom field entries Array<CustomField>
custom_field[id] custom field's numeric ID Integer
custom_field[name] name of the custom field (also the text displayed on the user's profile page) String
custom_field[order] the position in which this custom field should be displayed Integer

Example Curl Commands

curl -X GET -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/custom_fields.json

Examples

GET /api/custom_fields.json
200
{
  "custom_fields": [
    {
      "id": 3,
      "name": "favorite type of monkey",
      "order": 1
    }
  ]
}

GET /api/custom_fields/:id
retrieve a single custom field

Success Response Code: 200

Params

Param name Description
id
required

custom field id


Value: Must be a String

Response Fields

custom_field[id] custom field's numeric ID Integer
custom_field[name] name of the custom field (also the text displayed on the user's profile page) String
custom_field[order] the position in which this custom field should be displayed Integer

Example Curl Commands

curl -X GET -v --basic -u "emily@socialcast.com:demo" https://demo.socialcast.com/api/custom_fields/4.json

Examples

GET /api/custom_fields/3.json
200
{
  "custom_field": {
    "id": 3,
    "name": "favorite type of monkey",
    "order": 1
  }
}

POST /api/custom_fields
create a new custom field

Success Response Code: 201

Params

Param name Description
name
required

name of field


Value: Must be a String

Response Fields

custom_field newly created custom field CustomField
custom_field[id] custom field's numeric ID Integer
custom_field[name] name of the custom field (also the text displayed on the user's profile page) String
custom_field[order] the position in which this custom field should be displayed Integer

Example Curl Commands

curl -X POST -v --basic -u "administrator@socialcast.com:admin_password" https://demo.socialcast.com/api/custom_fields.json -H"Content-Type: application/json" -d '{"custom_field":{"name":"Languages that I speak","order":1}}'

PUT /api/custom_fields/:id
modify an existing custom field

Success Response Code: 200

Params

Param name Description
name
optional

name of field


Value: Must be a String

Response Fields

custom_field updated custom field CustomField
custom_field[id] custom field's numeric ID Integer
custom_field[name] name of the custom field (also the text displayed on the user's profile page) String
custom_field[order] the position in which this custom field should be displayed Integer

Example Curl Commands

curl -X PUT -v --basic -u "administrator@socialcast.com:admin_password" https://demo.socialcast.com/api/custom_fields/12.json -H"Content-Type: application/json" -d'{"custom_field":{"name":"Languages that I speak fluently"}}'

DELETE /api/custom_fields/:id
destroy a custom field

Success Response Code: 204

Params

Param name Description
id
required

id of custom field


Value: Must be a String

Example Curl Commands

curl -X DELETE -v --basic -u "administrator@socialcast.com:admin_password" https://demo.socialcast.com/api/custom_fields/12.json

Examples

DELETE /api/custom_fields/3.json
{}
204