API Reference

Users.getConnections


Syntax

array users.getConnections ( int vhost, mixed emailList = array(), array phoneList = array(), int userId = 0, mixed mediaId = 0 )

Arguments

NameTypeRequiredDefault valueDescription
vhostintRequirednoneThe id of the vhost.
emailListmixedOptionalarray()
phoneListarrayOptionalarray()An array of phone numbers to lookup
userIdintOptional0User ID, if provided user list will state if users are already connected via isFollowed
mediaIdmixedOptional0

Array key / value pairs

The possible key value pairs that you can use in your userData array.

NameTypeRequiredDefault ValueDescription
userSTRINGOptionalnoneUsername for the account. The user parameter must only contain letters (a-z or A-Z), digits (0-9), underscore (_), hyphen (-), period (.), and the "at" sign (@).
emailSTRINGOptionalnoneEmail address for the account holder. This has to be a properly formatted email address.
phoneSTRINGOptionalnoneThe account holders phone number.
countrycodeINTEGEROptionalnoneThe account holders phone country code.
firstnameSTRINGOptionalnoneFirstname for the account holder
lastnameSTRINGOptionalnoneLastname for the account holder
passwordSTRINGOptionalrandom stringPassword for the account holder (if none is provided the system will generate one and send it to the user)
address1STRINGOptionalnoneThe account holders address.
address2STRINGOptionalnoneA second line for the account holders address.
citySTRINGOptionalnoneThe account holders city.
languageSTRINGOptionalnoneThe language the account holder is using poss.
stateSTRINGOptionalnoneThe account holders state/province.
countrySTRINGOptionalnoneThe account holders country.
postalcodeSTRINGOptionalnoneThe account holders zip or postal code.
birthdateSTRINGOptionalnoneThe account holders birth date.
cellphoneSTRINGOptionalnoneThe account holders cell phone.
phoneSTRINGOptionalnoneThe account holders phone number.
websiteSTRINGOptionalnoneThe account holders website.
accounttypeSTRINGOptional0The account type for the account holder.
occupationSTRINGOptionalnoneThe account holders occupation.
newsletterBOOLEANOptional0Whether the account holder wants to receive a newsletter.
profile_completeBOOLEANOptional0If a users profile should be marked as complete or not.
genderCHARNot requirednoneThe account holders gender, acceptable values are M or F.
metaSTRINGOptionalnoneAny meta data you wish to store about the account holder.
external_idSTRINGOptionalnoneThe id provided by a 3rd party external authorization system.
NB: This is to be used with 'external_id_provider'.
external_id_providerINTEGEROptionalnoneThe integer that represents the 3rd party that provided the external id.
Possible values are:
  • 1 (Facebook)
  • 4 (Janrain)
  • 5 (Gigya)
  • 6 (Stripe)
  • 7 (Google)
  • 8 (Apple)
  • 9 (Twitter)
  • 10 (Instagram)
  • 11 (YouTube)

NOTE: The external_id_provider is required if external_id is passed.

Response

Below are the fields available in the returned array.

NameTypeDescription
idINTThe user id for the requested users.
userSTRINGThe user name for the requested users.
firstnameSTRINGThe first name for the requested users.
lastnameSTRINGThe last name for the requested users.
avatarINTThe media items that the users may be using as their avatar.
citySTRINGThe city in which the requested users live.
countrySTRINGThe country in which the requested users live.
genderCHARThe gender of the requested users. M for male and F for female.
birthdateDATEThe date of birth for the requested users.
languageSTRINGThe user's preferred language. A two character ISO country code will be used.
emailSTRINGThe e-mail address of the requested users.
phoneSTRINGThe users phone number.
cellphoneSTRINGThe user's cell phone number.
stateSTRINGThe state in which the requested users live.
lastloginDATETIMEThe date and time that the user was last logged into the system.
geo_latitudeFLOATThe geographical latitude of the requested users.
geo_longitudeFLOATThe geographical longitude of the requested users.
publicfilesINTThe total number of media items the user has uploaded to the system.
NOTE: You can find the value of notdeniedfiles by subtracting deniedfiles from publicfiles.
unmoderatedfilesINTThe number of media items that the user has uploaded to the system that are yet to be moderated.
approvedfilesINTThe number of media items the user has uploaded to the system that have been approved.
deniedfilesINTThe number of media items the user has uploaded to the system that have been denied.
unmoderatedcommentsINTThe number of comments the user has posted that have yet to be moderated.
approvedcommentsINTThe number of comments the user has posted that have been approved.
NOTE: You can find the value of notdeniedcomments by calculating the sum of approvedcomments plus unmoderatedcomments.
deniedcommentsINTThe number of comments the user has posted that have been denied.
notdeniedcommentsINTThe number of comments the user has posted that have been approved or have yet to be mopderated.
newsletterBOOLEANWhether or not the user has requested the newsletter, 0 is false, 1 is true.
deviceinfoARRAYAn array of the user's devices. The values returned are as follows: (with i being the iterator of the user's devices, should the user have more than one)

  • deviceinfo[i]['id'] - (Integer) The id of the device. ie. 54321
  • deviceinfo[i]['uid'] - (Integer) The id of the user.
  • deviceinfo[i]['vhost'] - (Integer) The id of the vhost.
  • deviceinfo[i]['device_id'] - (String) The string id of the device.
    ie: 1f6d530974e0aae8d6ad52734bcead167edab73d40127f8ec762f42d674386fb
  • deviceinfo[i]['latitude'] - (FLoat) The latitude of the device. Ie: 43.635609
  • deviceinfo[i]['longitude'] - (FLoat) The longitude of the device. Ie: -79.424858
  • deviceinfo[i]['lastupdatetime'] - (Datetime) The datestamp of the last occurance that the device was used to connect to the application. Ie: 2012-12-07 11:40:56
  • deviceinfo[i]['commentnotification'] - (Integer) Indicates whether the user enabled their comment notifications or not. Values: 1 (yes) or 0 (no)
  • deviceinfo[i]['assignmentnotification'] - (Integer) Indicates whether the user enabled their assignment notifications or not. Values: 1 (yes) or 0 (no)
  • deviceinfo[i]['settings'] - a serialized string with the user's settings: ie: a:1:{s:22:"notificationBadgeCount";s:1:"0";}
  • deviceinfo[i]['distance'] - (integer) The distance in meters from the deviceGeoCenter. This is returned only if filters[deviceGeoDistance] and filters[deviceGeoCenter] are provided.
externalidsARRAYThe user's external IDs, if any.
createdDATETIMEThe date and time that the user was created.
profile_completeINTIs the user's profile complete. 1 - yes, 0 - no.
disable_media_notificationsINTHas the user disbled their media notifications: 1 - yes, 0 - no.
disable_thread_notificationsINTHas the user disbled their thread notifications: 1 - yes, 0 - no.
occupationSTRINGThe user's occupation.
friendsINTThe number of user's accepted friends.
followersINTThe number of user's following the user.
followingINTThe number of user's the user follows.
vhostINTThe application that the user is in.
metaARRAYThe user's meta data.
activeINTIndicates whether or not a user account is active:
1 = active, 0 = inactive.
disabledINTIndicates whether or not a user account is disabled:
1 = disabled, 0 = enabled.
gravataridSTRINGAn md5 hash of the user's email address, which is used to confirm the user's gravatar.

Sample Response

Code examples

0 comments

Be the first to comment on getConnections.

Add a Comment

  • captcha