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.360alumni.com/api/doc/
Your system:
https://<<your-system>>.360alumni.com/api/doc

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.
A) Enter your API key in an HTTP request header.
B) Enter a string email address for the email parameter.
C) Enter a name for the first_name parameter.
D) Enter a name for the last_name parameter.
E) Enter 0 | 1 for the enabled parameter.
F) Enter an array ["admin" | "user"] for the groups parameter.
G) 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:
A) Enter your API key in an HTTP request header.
B) Click Try! to execute the API request.

4. The Response Body contains a JSON array of User Objects.

5. 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.
A) Enter your API key in an HTTP request header.
B) Enter a value for the id parameter.
C) 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.
A) A JSON user object is required for the content. Copy your changed JSON user object into the Content field on the form.
B) Set the content type.
C) Enter the Content-Type as application/json and click Set header.
D) Enter your API key in another HTTP request header.
E) Click New header and enter x-api-key and your API key value.
F) Enter a value for the id parameter.
G) Click Try! to execute the API request.

The PUT /api/users/{id} Request:

PutAPIUserID.png


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

Response body:

ResponseBodyPut.png

Name

Type

Required

Description

Format

amount

number

Required

Words

campaign_id

number

Required

Words

created_at

string

Words

Words

first_name

string

Words

id

string

Words

Words

last_name

string

Words

user_id

number

Words

JSON Donation Object Sample

The following JSON Donation object is suitable for copying.

[
 {
   "id": "14",
   "campaign_id": 16,
   "user_id": 1102,
   "first_name": "Maria",
   "last_name": "Reile",
   "amount": 15,
   "created_at": "2013-12-12 22:59:38",
   "transaction_id": "5770260782"
 }
]

Name

Type

Required

Description

Format

ambassadors

array of ambassador objects

optional

See ambassador object below.

author

author object

optional

See the author object below.

createdAt

string

The date this campaign record was created.

.YYYY-MM-DD Year-Month-Day

details

string

The detailed description of the organisation and campaign.

end_date

string

The date the campaign ends.

.YYYY-MM-DD Year-Month-Day

goal

number

The monetary goal for the campaign,

id

number

Required

A unique ID for this campaign auto-generated by 360Alumni.

image

string

A URL to an image representing the campaign or organization.

URL

islnactive

number

The status of whether the campaign is active. 1: is active 0: is inactive

raised

number

The monetary amount raised by the campaign.

start_date

string

The date the campaign starts.

.YYYY-MM-DD Year-Month-Day

thank_you_message

string

A thank-you message that can be sent to donors.

title

string

Required

The title for the campaign.

type

string

The type of the campaign length such as short or ongoing.

updatedAt

string

The date this campaign record was modified.

.YYYY-MM-DD Year-Month-Day

Ambassador Object

Name

Type

Required

Format

user_id

number

Required

The user ID identifying an ambassador for the campaign generated by 360Alumni. See also the User Object.

first_name

string

Required

The ambassador's first name.

last_name

string

Required

The ambassador's last name.

JSON Campaign Object Sample

{
  "id": 17,
  "title": "Aspiring Director's Fund",
  "details": "<p>The Motion Picture Association (MPA) and the Asia Pacific Screen Awards (APSA) gives an opportunity to aspiring filmmakers with the MPA APSA Academy Film Fund. MPA APSA Academy Film Funds is a unique initiative which has aided aspiring film makers in a lot of development in new film projects.</p>",
  "goal": 501,
  "thank_you_message": "Dear #name#,\r\n\r\nThank you for your $#amount# donation to the #title# campaign! We truly appreciate your support.\r\nEvery bit helps, and you've taken us one step closer to achieving our goal.\r\nCheck back often to see which of your friends have donated, and the progress we've made. \r\n\r\nThanks for helping us to make this our most successful year yet!\r\n\r\nSincerely, 360Alumni Support",
  "type": "short",
  "start_date": "2013-11-15 00:00:00",
  "end_date": "2017-01-31 00:00:00",
  "createdAt": "2013-11-15 17:33:07",
  "updatedAt": "2016-06-16 11:42:09",
  "isInactive": null,
  "author": {
    "user_id": 1092,
    "first_name": "Georgette",
    "last_name": "Lucas"
  },
  "raised": "465",
  "image": "/cdn/images/f19cb30cf19d512a9de8f487a5bc1d13.jpg",
  "ambassadors": [
      {
      "user_id": 1103,
      "first_name": "Ken",
      "last_name": "Richardson"
      }
   ]
}

JSON Field
(* = Required)

JSON Type (size)

Valid Values

Description

Format

about
text
A text description of the user.
activated_at
string (255)
The date the user's account was activated.
YYYY-MM-DD Year-Month-Day
admin_notes
text
Notes by the client administrator.

approved
number (6)
1, 0
The user's approval status.
1: The user's account is approved.
0: The user's account is not approved.
bad_email
number (11)
1, 0
The status of the validity of the email address. See also the email field.
1: Email is valid.
0: Email is not valid.
client_id
number (11)
The client ID.
createdAt
string (255)
The date the user's account was created.
YYYY-MM-DD Year-Month-Day
custom_fields
array
An array of optional custom-defined fields.
{"custom-field-name" : "custom-field-value" },
dob_day
number (11)
01 - 31
Date of birth day. The two digit day in the month of the user's birth day.
DD
dob_month
number (11)
01 - 12
Date of birth month. The two digit month of the user's birth day.
MM
dob_year
number (11)
Date of birth year. The year of the user's birthday.
YYYY
email*
string (255)
The user's email address
emma_member_id
string (255)
The user's EMMA member number from the EMail Marketing Association.
enabled
number (11)
1, 0
The status of whether the user's account is enabled or not.
1: enabled
0: not enabled
facebook_link
string (255)
The user's facebook URL link.
URL
first_login
number (11)
1, 0
The status of whether the user has logged in for the first time.
1: The user has logged in at least once.
0: The user has not logged in yet.
first_name*
string (255)
User's first name.
gender
character (1)
m, f
The user's gender.
groups
array
An array of optional user group names (string) of which this user is a member.
For example, "admin", "read-only", and so on.
groups [ "group-name1", "group-name2" ]
hard_bounce
number (11)
Number of email hard bounces.
When an email is rejected by a subscriber's email server due to a permanent delivery error, it's called a hard bounce.
home_address1
string (255)
The first line of the home address.
home_address2
string (255)
The second line of the home address.
home_city
string (255)
The city of the home address.
home_country
number (11)
The two-letter postal abbreviation for the country of the home address.
home_geohash
The home geographic location in the geohash form of a short string of letters and digits.
home_geohash_l1
The home geohash value to 1 digit precision.
home_geohash_l2
The home geohash value to 2 digit precision.
home_geohash_l3
The home geohash value to 3 digit precision.
home_geohash_l4
The home geohash value to 4 digit precision.
home_geohash_l5
The home geohash value to 5 digit precision.
home_geohash_l6
The home geohash value to 6 digit precision.
home_lat
number (10.7)
The geographical latitude of the home address.
home_lng
number (10.7)
The geographical longitude of the home address.
home_phone
string (255)
User's home telephone number.
home_state
number (11) ?
The two-letter postal abbreviation for the state of the home address.
SS
home_zipcode
string (255)
The postal zip code of the home address.
#####[-####]
image
A picture of the user.
inst_id
string (255)
instagram_link
string(255)
The user's Instagram URL link.
URL
isConfirmed
1, 0
isPrimary
1, 0
is_import_user
number (6)
1, 0
The status of whether the user's account was created from an import or not.
1: The user's account is imported.
0: The user's account is not imported.
last_activity_at
string (255)
The date of last activity for the user's record.
YYYY-MM-DD Year-Month-Day
last_login
string (255)
The date the user last logged in.
YYYY-MM-DD Year-Month-Day
last_name*
string (255)
The user's last name.
linkedin_link
string (255)
The user's LinkedIn URL link.
URL
maiden_name
string (255)
The user's maiden name.
middle_name
string (255)
The user's middle name.
mobile_phone
string (255)
The user's mobile phone number.
name_suffix
A name suffix (such as PhD or Jr.)
name_title
A name title (such as Ms, Mr, Dr.)
nickname
string (255)
A user's nickname.
preferred_email
number (6)
The user's preferred email.
preferred_phone
number (6)
The user's preferred email.
profile_url
string (255)
Personal URL. Allow to access own personal profile page.
salt
string (255)
secondary_email
string (255)
A secondary user email.
soft_bounce
number (11)
The number of email soft bounces.
When an email is rejected by a subscriber's email server due to a temporary email delivery issue, it's called a soft bounce.
tags
array
An array of optional tag names (string) associated with this user. Tags provide labels representing any subject that can be applied to any user.
tags [ "tag-name1", "tag-name2" ]
terms_and_conditions
number (6)
1, 0
The status of whether the user has agreed to the Terms and Conditions.
1: has agreed
0: has not agreed
twitter_link
string (255)
unsubscribe
number (11)
updatedAt
string (255)
The date the user's account was last updated.
YYYY-MM-DD Year-Month-Day
user_career_info
user_id*
auto-generated by 360Alumni
user_industry
user_language
user_publication
array
user_skill
user_study_area*
array
auto-generated by 360Alumni
user_timezone
string (255)
The timezone of the user's home address.
username
string (255)
website
string (255)
The work website URL.
URL
work_address1
string (255)
The first line of the work address.
work_address2
string (255)
The second line of the work address.
work_city
string (255)
The city of the work address.
work_country
number (11)
The two-letter postal abbreviation for the country of the work address.
work_geohash
The work geographic location in the geohash form of a short string of letters and digits.
work_geohash_l1
The work geohash value to 1 digit precision.
work_geohash_l2
The work geohash value to 2 digit precision.
work_geohash_l3
The work geohash value to 3 digit precision.
work_geohash_l4
The work geohash value to 4 digit precision.
work_geohash_l5
The work geohash value to 5 digit precision.
work_geohash_l6
The work geohash value to 6 digit precision.
work_lat
number (10.7)
The geographical latitude of the work address.
work_lng
number (10.7)
The geographical longitude of the work address.
work_phone
string (255)
User's work telephone number.
work_state
number (11)
The two-letter postal abbreviation for the state of the work address.
SS
work_zipcode
string (255)
The postal zip code of the work address.
#####[- ####]
year_graduated
number (11)
The year the user graduated.
YYYY

JSON User Object Sample

The following JSON User object is suitable for copying.

[
 {
   "about": "Lorem ipsum Lorem ipsum",
   "activated_at": "1970-01-01 00:00:00",
   "admin_notes": null,
   "approved": 1,
   "bad_email": 0,
   "client_id": 5,
   "createdAt": "2013-11-08 11:53:41",
   "custom_fields": [],
   "dob_day": null,
   "dob_month": null,
   "dob_year": null,
   "email": null,
   "emma_member_id": null,
   "enabled": 1,
   "facebook_link": null,
   "first_login": 1,
   "first_name": "360Alumni",
   "gender": null,
   "groups": [
     "admin"
   ],
   "hard_bounce": 0,
   "home_address1": null,
   "home_address2": null,
   "home_city": "westport",
   "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": "123-456-7991",
   "home_state": null,
   "home_zipcode": "06880",
   "image": "/cdn/images/e7dba1170d2a97fcc4bef6c4afaf2f99.png",
   "inst_id": "0034100000AQCVFAA5",
   "instagram_link": null,
   "isConfirmed": 1,
   "isPrimary": 1,
   "is_import_user": 0,
   "last_activity_at": "1970-01-01 00:00:00",
   "last_login": "2014-09-02 13:37:25",
   "last_name": "Demo",
   "linkedin_link": null,
   "maiden_name": null,
   "middle_name": null,
   "mobile_phone": "123-456-7890",
   "name_suffix": null,
   "name_title": null,
   "nickname": null,
   "preferred_email": null,
   "preferred_phone": null,
   "salt": "",
   "secondary_email": [],
   "soft_bounce": 11,
   "tags": [],
   "terms_and_conditions": 1,
   "twitter_link": null,
   "unsubscribe": 0,
   "updatedAt": "2016-10-28 03:04:02",
   "user_career_info": [],
   "user_id": 1090,
   "user_industry": [],
   "user_language": [],
   "user_skill": [],
   "user_study_area": [
     {
       "study_area": "Associate in Fine Arts",
       "year": [
         "2012"
       ],
       "study_organization": "business"
     }
   ],
   "user_timezone": null,
   "username": null,
   "website": null,
   "work_address1": null,
   "work_address2": null,
   "work_city": null,
   "work_country": null,
   "work_geohash": "9yegjbpfrcz",
   "work_geohash_l1": "9",
   "work_geohash_l2": "9y",
   "work_geohash_l3": "9ye",
   "work_geohash_l4": "9yeg",
   "work_geohash_l5": "9yegj",
   "work_geohash_l6": "9yegjb",
   "work_lat": "37.0902400",
   "work_lng": "-95.7128910",
   "work_phone": null,
   "work_state": null,
   "work_zipcode": null,
   "year_graduated": 2012
 }
]

Type

Format

Description

Date

YYYY-MM-DD

Year-Month-Day. Example: 2018-03-21

Realize the power of your network

Unlock your organization’s potential

Get Demo