Search

Creating and Updating Users

You can create new users in the system and give them the appropriate access. This is because you have access to more than just the information provided by the 360Alumni GUI and you can perform complex operations such as approving users when they are created. 

  1. Create a New User with POST /api/users/
  2. Get an Array of User Records with GET /api/users/
  3. Get a Specific User's Record with GET /api/users/{id}
  4. Update a User Record with PUT /api/users/{id}

Use one of the following URLs to open the API reference.

Test system https://demo.s.360alumni.com/api/documentation
Your system https://your-system.360alumni.com/api/documentation

Create a New User with POST /api/users/


Follow these steps to create a user.

  1. Click the POST /api/users/ method.
    Required parameters to create a new user include first_name, last_name and enabled. These parameters as well as all the optional parameters are described in the User Object reference.

  2. Click Sandbox to display the form for entering values and trying the request.

    1. Enter your API key in an HTTP request header.
    2. Enter a string email address for the email parameter.
    3. Enter a name for the first_name parameter.
    4. Enter a name for the last_name parameter.
    5. Enter 0 | 1 for the enabled parameter.
    6. Enter an array ["admin" | "user"] for the groups parameter. 
    7. Click Try! to execute the API request.

      The POST /api/users/ Request
      PostRequest.png

  3. The Response Body shows the JSON results.
    Note that the user_id field uniquely identifies a user. Make a note of this value to use for identifying the user in later examples.

    Note: If the response header is "400 Bad Request" try sending the request as a JSON through the Content Textarea. 
    Workaround.png

Get an Array of User Records with GET /api/users/


  1. Click the GET /api/users/ method.
    Note that the page parameter is required and the default value is 1.

  2. Click Sandbox to display the form for entering values and trying requests.

  3. To request all user records:

    1. Enter your API key in an HTTP request header.
    2. Click Try! to execute the API request.

  4. The Response Body contains a JSON array of User Objects.
    Note that the user_id field uniquly identifes each user. Save one of the user_id values to use in later examples.

    Examples of user_id fields in the Response
        
    [
      ...
      {
        ...
        "updatedAt": "2016-04-27 19:20:25",
        "user_id": 1196,
        "user_timezone": null,
        ...
      },
      {
        ...
        "updatedAt": "2016-08-09 18:28:03",
        "user_id": 234063,
        "user_timezone": null,
        ...
      }
      {
        "about": null,
        "activated_at": null,
        "admin_notes": null,
        "approved": 1,
        ...
    ]
        
    

Get a Specific User's Record with GET /api/users/{id}


  1. Click the GET /api/users/{id} method.
    The single required parameter is the user_id.

  2. Click Sandbox to display the form for entering a user ID and trying the request.

    1. Enter your API key in an HTTP request header.
    2. Enter a value for the id parameter.
    3. Click Try! to execute the API request.

      The GET /api/users/{id} Request
      GetAPIUserRequest.png

  3. The single User Object is returned. Copy and save the JSON object from the Response Body to use in the next example.

    A User Object

        
    [
      {
        "about": "New description of this user in the about field.",
        "activated_at": "2016-06-22 01:07:19",
        "admin_notes": null,
        "approved": 1,
        "bad_email": 0,
        "client_id": 5,
        "createdAt": "2016-06-22 01:07:19",
        "custom_fields": [],
        "dob_day": null,
        "dob_month": null,
        "dob_year": null,
        "email": null,
        "emma_member_id": null,
        "enabled": 0,
        "facebook_link": null,
        "first_login": null,
        "first_name": "Christina",
        "gender": null,
        "groups": [
          "user"
        ],
        "hard_bounce": 0,
        "home_address1": null,
        "home_address2": null,
        "home_city": null,
        "home_country": null,
        "home_geohash": null,
        "home_geohash_l1": null,
        "home_geohash_l2": null,
        "home_geohash_l3": null,
        "home_geohash_l4": null,
        "home_geohash_l5": null,
        "home_geohash_l6": null,
        "home_lat": null,
        "home_lng": null,
        "home_phone": null,
        "home_state": null,
        "home_zipcode": null,
        "image": null,
        "inst_id": null,
        "instagram_link": null,
        "isConfirmed": 0,
        "isPrimary": null,
        "is_import_user": 0,
        "last_activity_at": "2016-06-22 01:07:26",
        "last_login": "2016-06-22 01:07:19",
        "last_name": "attendee",
        "linkedin_link": null,
        "maiden_name": null,
        "middle_name": null,
        "mobile_phone": null,
        "name_suffix": null,
        "name_title": null,
        "nickname": null,
        "preferred_email": null,
        "preferred_phone": null,
        "salt": "",
        "secondary_email": [],
        "soft_bounce": 0,
        "tags": [],
        "terms_and_conditions": 1,
        "twitter_link": null,
        "unsubscribe": 0,
        "updatedAt": "2016-08-09 18:28:03",
        "user_career_info": [],
        "user_id": 234063,
        "user_industry": [],
        "user_language": [],
        "user_skill": [],
        "user_study_area": [],
        "user_timezone": null,
        "username": null,
        "website": null,
        "work_address1": null,
        "work_address2": null,
        "work_city": null,
        "work_country": null,
        "work_geohash": null,
        "work_geohash_l1": null,
        "work_geohash_l2": null,
        "work_geohash_l3": null,
        "work_geohash_l4": null,
        "work_geohash_l5": null,
        "work_geohash_l6": null,
        "work_lat": null,
        "work_lng": null,
        "work_phone": null,
        "work_state": null,
        "work_zipcode": null,
        "year_graduated": null
      }
    ]
        
    

Update a User Record with PUT /api/users/{id}


  1. Copy the JSON user object from the response in the previous example into an editor and change a few field values.

  2. Click the PUT /api/users/{id} method. The required parameter is the user_id.

  3. Click Sandbox to display the form for entering information and trying the request.

    1. A JSON user object is required for the content. Copy your changed JSON user object into the Content field on the form.
    2. Set the content type.
      Enter the Content-Type as application/json and click Set header.
    3. Enter your API key in another HTTP request header.
      Click New header and enter x-api-key and your API key value.
    4. Enter a value for the id parameter.
    5. Click Try! to execute the API request.

      The PUT /api/users/{id} Request
      PutAPIUserID.png

  4. If the request is successful the Response Body indicates the user record was updated.

    Response body
    ResponseBodyPut.png