Update contacts added by SSO

Problem

The Single Sign-On (SSO) auto-provisioning feature can create a member/student record when someone signs in to GoBook or GoJoin for the first time using their university Microsoft account. After that first sign-in, a follow-up process will be needed to complete the member/student record: find the new record, read that member's profile, add date of birth, add address details, add contact details, add a member card id, add student identifier to a user field and other similar fields.

Resolution

The steps below show example API endpoint calls that may be useful when designing this follow-up API flow.

  1. Find records (profiles) created with a specific status and time-frame

    • Use List all member profiles with filtering and pagination to poll the member profile list with a date window and a status filter.
    • The date window on this endpoint is based on the member record's modifiedOn value, not specifically on createdOn. If you need records created today, use the date window to reduce the result set, then check each returned profile's createdOn value before acting on it.
    cURL
    curl -G '{base_url}/api/members/profiles' \
      -H 'Authorization: Bearer ***' \
      -H 'X-Use-SSO: true' \
      --data-urlencode 'dateFrom=2026-10-02T00:00:00Z' \
      --data-urlencode 'dateTo=2026-10-02T23:59:59Z' \
      --data-urlencode 'statusIds=PROSP' \
      --data-urlencode 'includeContactDetails=true'
    • Keep paging until the response returns an empty profiles array and an empty continuation-token. Send the same dateFrom, dateTo, statusIds and include* flags on every page, together with the continuation-token from the previous response.
    • The memberId on each returned profile is the value to pass as {memberId} to the per-member calls below.
  2. Read one member profile before updating it

    cURL
    curl -X GET '{base_url}/api/members/{memberId}/profile?includeStatus=true&includeContactDetails=true' \
      -H 'Authorization: Bearer ***' \
      -H 'X-Use-SSO: true'
    • Use this response to shape the updates in the following steps.
  3. Update title and date of birth

    • Use Update a member's basic profile details to set only the profile fields you need to change.
    • titleId is the exception to the endpoint's normal partial-update behaviour: omitting it, sending null, or sending an empty string resets the member's title to the default UNKNO. If you are only changing dateOfBirth, send the current titleId you read in step 2.
    cURL
    curl -X PUT '{base_url}/api/members/{memberId}/profile' \
      -H 'Authorization: Bearer ***' \
      -H 'X-Use-SSO: true' \
      -H 'Content-Type: application/json' \
      -d '{
        "titleId": "MR",
        "dateOfBirth": "2004-09-21T00:00:00Z"
      }'
    • A successful call returns 204 No Content. Validation is all-or-nothing, so nothing is written when the request fails.
  4. Update member user fields

    cURL
    curl -X PUT '{base_url}/api/members/{memberId}/user-fields' \
      -H 'Authorization: Bearer ***' \
      -H 'X-Use-SSO: true' \
      -H 'Content-Type: application/json' \
      -d '[
        {
          "userFieldId": 1,
          "value": "26049581"
        },
        {
          "userFieldId": 2,
          "value": "Computer Science"
        }
      ]'
    • This call is a merge, not a replacement. Fields you do not send keep their existing values. The whole array is validated before anything is saved, so one invalid field rejects the entire update.
  5. Add phone number

    • Use Update member contact details using JSON Patch to set the member's mobile phone number with PATCH /api/members/{memberId}/contact-details.
    • Contact details are updated with a JSON Patch array. To update the mobile number, replace the fixed /mobile/number slot. If the mobile number should also become the member's primary phone number, set /mobile/isPrimary to true and clear any existing primary phone flag in the same request, because only one of telephone1, telephone2 and mobile can be primary.
    cURL
    curl -X PATCH '{base_url}/api/members/{memberId}/contact-details' \
      -H 'Authorization: Bearer ***' \
      -H 'X-Use-SSO: true' \
      -H 'Content-Type: application/json' \
      -d '[
        {
          "op": "replace",
          "path": "/mobile/number",
          "value": "07123456789"
        },
        {
          "op": "replace",
          "path": "/mobile/isPrimary",
          "value": true
        },
        {
          "op": "replace",
          "path": "/telephone1/isPrimary",
          "value": false
        }
      ]'
    • A successful call returns 204 No Content. Telephone numbers are limited to 50 characters and are not format-checked.
  6. Add address details

    • Use Update member address details to set the member's home address with PUT /api/members/{memberId}/addresses.
    • Including an address object replaces that whole address, so send each line you want to keep. Lines omitted from an included address object are saved as empty strings.
    cURL
    curl -X PUT '{base_url}/api/members/{memberId}/addresses' \
      -H 'Authorization: Bearer ***' \
      -H 'X-Use-SSO: true' \
      -H 'Content-Type: application/json' \
      -d '{
        "address1": {
          "addressLine1": "1 Lupton Road",
          "addressLine2": "",
          "addressLine3": "",
          "townCity": "Wallingford",
          "region": "Oxfordshire",
          "postalCode": "OX10 BT",
          "country": "",
          "isPrimary": true
        }
      }'
    • A successful call returns 204 No Content.

Notes

This page as markdown · All pages · llms.txt