GET https://:subdomain.cobot.me/api/space/custom_fields
This returns the fields that are set up for the space. Before assigning any custom filds to a membership, they must first be set up for the space.
Response:
[{ "label": "Phone", "id": "eee69b28fed5806e62be5ce3cf6a1733" }]
PUT https://:subdomain.cobot.me/api/space/custom_fields
This updates the custom fields of the space. Any fields not included in the request will be removed from the space and from all members.
Existing fields must be included with their id and label. To add new fields, submit just a label.
PUT https://co-up.cobot.me/api/space/custom_fields
Body:
[ { "id": "eee69b28fed5806e62be5ce3cf6a1733", "label": "Phone" }, { "label": "Mobile" } ]
Response:
[ { "id": "eee69b28fed5806e62be5ce3cf6a1733", "label": "Phone" }, { "id": "f0120b28fed5806e62be5ce3cf6af087", "label": "Mobile" } ]
GET https://:subdomain.cobot.me/api/memberships/:membership_id/custom_fields
This returns the custom fields for one membership.
GET https://co-up.cobot.me/api/memberships/873d25c0a87507fa5301275/custom_fields
Response:
{ "membership_id": "873d25c0a87507fa5301275", "fields": [ { "label": "Phone", "value": "12345", "id": "eee69b28fed5806e62be5ce3cf6a1733" } ] }
GET https://:subdomain.cobot.me/api/custom_fields
This returns the custom fields for all memberships.
GET https://co-up.cobot.me/api/custom_fields
Response:
[ { "membership_id": "873d25c0a87507fa5301275", "fields": [ { "label": "Phone", "value": "12345", "id": "eee69b28fed5806e62be5ce3cf6a1733" } ] } ]
You can pass an optional membership_ids
query parameter, containing a comma
separated list of membership ids to return custom fields for. Without this
parameter, the custom fields of all currently active memberships is returned.
PUT https://:subdomain.cobot.me/api/memberships/:membership_id/custom_fields
This updates the custom fields of the member. Only fields present in the request body are updated, other fields are left in place.
PUT https://co-up.cobot.me/api/memberships/873d25c0a87507fa5301275/custom_fields
Body:
[{ "id": "eee69b28fed5806e62be5ce3cf6a1733", "value": "12345" }]
Response:
[ { "membership_id": "873d25c0a87507fa5301275", "fields": [ { "label": "Phone", "value": "12345", "id": "eee69b28fed5806e62be5ce3cf6a1733" } ] } ]