getOrCreate
- Home
- Accounts & Sessions
- User
- getOrCreate
getOrCreate
Retrieves an existing user or attempts to create one if none is found.
Parameters
Name | Description |
node_id optional | Node ID |
domain optional | Domain |
external_provider_name optional | External Provider Name |
external_user_identifier optional | External User Identifier |
external_access_token optional | External Access Token |
email optional | Email Address |
username optional | Username |
password optional | Password |
subdir optional | Subdir |
first_name optional | First name |
last_name optional | Last Name |
display_name optional | Display Name |
birthday optional | Date of Birth (Unix Timestamp) |
gender optional | Gender |
avatar optional | Avatar |
coupon_code optional | Coupon Code |
ip optional | IP Address |
account_status optional | Account Status |
phone optional | Phone Number |
address optional | Street Address |
address_2 optional | Street Address 2 |
city optional | City |
state optional | State |
zip optional | Zip Code |
country optional | Country |
referring_url optional | Referring URL |
last_blog_visited optional | Last Blog Visited |
add_friend optional | Add Friend |
join_group optional | Join Group |
group_member_status optional | Group Member Status |
quote optional | Personal Quote |
timezone optional | Timezone |
account_type optional | Account Type |
message_privacy optional | Message Privacy |
friends_approval optional | Friends Approval |
comments_approval optional | Comments Approval |
geo_zip optional | Geo Zip |
geo_market optional | Geo Market |
email_notification optional | Email Notification |
locale optional | Locale (Language/Country Code) |
is_searchable optional | Appears in Search Results |
dob_display optional | Birthday Display |
location optional | Custom Location |
group_broadcast optional | Receive Group Broadcasts |
show_online_status optional | Show Online Status |
allow_html_comments optional | Allow HTML Comments |
auto_generate_subdir optional | Allow HTML Comments |
add_to_tier optional | Add to Tier |
parent_user optional | Parent User |
skip_default_friends optional | Skip Default Friends |
send_confirmation_email optional | Send Confirmation Email |
Request Syntax
https://services.onesite.com/1/user/getOrCreate.json?username=newuser48&email=john.doe@example.com&password=6GZEvpLt9EwKJ4Fk&devkey=[devkey] |
JSON Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
{ "code":101, "message":"Created user with provided information.", "content":{ "user":{ "UserID":230171855, "Username":"newuser48", "Email":"john.doe@example.com", "Site":{ "SiteID":234957402, "Subdir":"230171855", "URL":"http://www.onesitedemo.com/230171855" }, "Avatar":"http://services.onesite.com/resources/images/unisex_v4b.gif?ver=13.06.21", "Name":"User", "AccountStatus":"good-standing", "DateCreated":1548975374, "Profile":{ "Birthday":64800, "FirstName":"User", "Gender":"Unspecified", "Language":"en_US" }, "Preferences":{ "BirthdayDisplay":"private", "FriendshipApproval":0, "CommentsApproval":1, "MessagePrivacy":0, "EmailNotification":"ongoing", "Searchable":true, "ShowOnlineStatus":true }, "ExternalAccounts":[ ], "Tiers":[ ] } } } |
Service Information
Service | user |
Method | getOrCreate |
Type | REST |
Response Types | JSON, XML |