Will create a user profile in the system. UserKey serves as the unique user id for the profile. By leaving the username and password field blank, the profile will not be able to be logged in. It is used for creating SSO with another system such as Facebook, OpenID or Windows Live ID.
The username and email fields are required to be unique. If there is a conflict when creating a new profile, the response object will contain a failure with the duplicateUserKey field set.
We do not currently allow the specific userkey "0" or any userkeys that contain a forward slash "/".
Method: POST /api/v3/publisher/profilestore/create
Authentication: oauth
Post
Required |
Form Name |
Data Type |
Explanation |
No
|
UserKey |
string |
The unique id for the user. This will be displayed for refer friends urls, so using the email address is discouraged. If not supplied, it will be generated automatically.
|
Yes
|
Email
|
string |
The email address for the profile. Unique across the system.
|
No
| FirstName
| string | The first name of the consumer.
|
No
| LastName
| string
| The last name of the consumer.
|
*1
|
Username |
string |
The username on the profile. Unique across the system.
|
*1
|
Password |
string |
The password on the profile.
|
*1
|
PasswordConfirm |
string |
The confirm password on the profile. Must match with Password.
|
| preferredIsoCurrencyCode | string
| The consumer's preferred iso currency code such as USD or EUR. |
No
|
ProfileData[0...n] |
ProfileDataItem
|
A collection of profile data items.
|
No | ReferredByUserKey | string | The user key of another profile if this profile was referred to the site.
|
No | SendEmail
| bool
| If true, a welcome email will be sent to the user who just created a profile (true by default).
|
*1 Username, Password, Password confirm are required if this profile can be logged in to with a username and password. Facebook Connect users will have these 3 fields blank.
ProfileDataItem
Required |
Form Name |
Data Type |
Explanation |
Yes
|
Key | string |
The key for the data item. Limited to 50 characters.
|
No
|
Value
|
string |
The value for this data item. Can be null. Limited to 50,000 characters.
|
No
|
IsUnique |
bool
|
Setting this value to true will enforce a unique constraint across all profile data items.
This should be used when storing the 3rd party authentication token and/or id. As this field can be queried against.
|
Returnsbase response fieldsduplicateUserKey - When the email or username violates the unique constraint, the existing profile's userkey will be returned.
userKey - The user key of the newly created profile. Useful when the user key is not passed in on the request.
Sample Request:
POST http://api.groupcommerce.com/api/v3/publisher/profilestore/create
Form: UserKey=055ee694-7570-4044-a4b8-108088b6edd0&Email=apisupport%40groupcommerce.com&Username=beardeddevelopers&Password=password2&PasswordConfirm=password2&ProfileData%5b0%5d.Key=FirstName&ProfileData%5b0%5d.Value=Sylvester&ProfileData%5b0%5d.IsUnique=False&ProfileData%5b1%5d.Key=LastName&ProfileData%5b1%5d.Value=Martin&ProfileData%5b1%5d.IsUnique=False&ProfileData%5b2%5d.Key=SamsClubCard&ProfileData%5b2%5d.Value=73879483874&ProfileData%5b2%5d.IsUnique=True&ReferAFriendInfo.ReferredByUserKey=
Authorization: OAuth oauth_signature="saSf4k%2fCJSLJ0JR1zxLxjYItgEU%3d", oauth_nonce="6676795", oauth_timestamp="1320277782", oauth_consumer_key="eeb6b959-b854-4ad1-b563-e801c83cf81d", oauth_signature_method="HMAC-SHA1", oauth_version="1.0"
Sample JSON Response:
{
"errors":[],
"lastPublished":"/Date(1320277782090)/",
"success":true,
"version":"3",
"duplicateUserKey":null,
"userKey": "
055ee694-7570-4044-a4b8-108088b6edd0
"
}
Sample XML Response:
<createProfileResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<errors/>
<lastPublished>2011-11-02T23:52:05.072545Z</lastPublished>
<success>true</success>
<version>3</version>
<duplicateUserKey i:nil="true"/>
<userKey>
055ee694-7570-4044-a4b8-108088b6edd0
</userKey>
</createProfileResponse>