The Registration Workflow in Connect API allows users to create an identity and profiles. The workflow links new profiles to existing identities and third party identity providers (e.g. Facebook). Only single-step registration is supported but the workflow has been designed to allow for multiple steps in the future.
Initialize specifies the Application being registered for and the IdentityProvider being used. Initialize validates the request and returns either an error message or a registration GUID. An asynchronous call is made to the IdentityProvider to pre-populate available information into the registration (e.g. FirstName from Facebook). It is recommended that the client cache registrationId so that registration may be resumed at a later point in time.
Fetch retrieves registration step(s) given the registration GUID. If Initialize's asynchronous call to the IdentityProvider has not completed, registration state will remain "Initializing". The client may choose to wait and call Fetch again until the state becomes "Active" or allow the user to continue. If the client chooses to wait, a timeout is advised so that the user is not blocked from registration. Each step has a template and set of metadata fields which must be completed by the user. Metadata may contain pre-populated values from the IdentityProvider. Metadata specifies rules which commonly indicate if a field is required.
CompleteStep validates and saves completed registration steps. CompleteStep validates the metadata values and returns the registration (similar to Fetch). The client should check the status of each step. If a step is "Incomplete" a metadata value did not pass validation. Values that do not pass validation will be returned as null. If all steps are "Completed" and the registration state is "Complete", the registration is ready to be Finalized. It is recommended that the client cache username and password so that a user token can be retreived without prompting for credentials after the user has verified their e-mail.
Finalize sends out a verification e-mail if the IdentityProvider's e-mail is not trusted or does not match the e-mail the user is signing up with. Once the user receives the e-mail and clicks the link, Finalize creates the identity (if applicable) and profile. Registration is done.
{ "Application":{ "Type":"MindbodySubscriberConsumer", "SubscriberId":-1211 }, "IdentityProviderRegistrationRequest":{ "Type":"FacebookConnect", "Username":"[email protected]", "Token":"CAAVHMp4zrIsBAFZAKz8eiDyL2diUdEcpkv0hMFxrcByVkJDZBfx0j9ZCe2VlyaURovb1ZCUr0Uw9byMRNa0VWLJZCmTwMhz9fVUzKMw3O1gWNku7zm6XEWJcn2PTTMPXZAoeCsVif2qcn8OaKhZAfCfSvwOQRZBVGrZASNkqpgUZCOXglP44Gjf6k2oFSjJFwcEyde5BOPbImodtxJOXDpPhs" } }
"645b1b24-25c9-420c-96df-82652af0f2ea"
{ "Id":"645b1b24-25c9-420c-96df-82652af0f2ea", "Created":"2015-07-24T15:38:17.951-07:00", "Modified":"2015-07-24T15:38:19.746-07:00", "Steps":[ { "Id":"8a198b0d-f325-42c0-9de5-8449c646c195", "Type":"CollectUserRegistrationMetadata", "Name":"User Registration Metadata Step", "Template":{ "Name":"User Registration Metadata Template", "Metadata":[ { "Key":"Password", "Value":null, "Type":"Password", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"Address Line 1", "Value":null, "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"Address Line 2", "Value":null, "Type":"String", "Rules":[ ], "Options":null }, { "Key":"City", "Value":null, "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"Email", "Value":null, "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"First Name", "Value":null, "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"LastName", "Value":null, "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"Postal Code", "Value":null, "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"State", "Value":null, "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"Preferred Location", "Value":null, "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":[ { "DisplayName":"Mile High Yoga", "Value":"1" } ] }, { "Key":"Index: Favorite Color", "Value":null, "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":[ { "DisplayName":"Green", "Value":"6" }, { "DisplayName":"Blue", "Value":"7" } ] } ] }, "Status":"Incomplete" } ], "Details":{ "Email":"[email protected]", "EmailVerified":false, "RegistrationOwnerUserId":null, "IdentityProviderType":"Mindbody", "IdentityProviderIdentifier":"", "Application":{ "Type":"MindbodySubscriberConsumer", "SubscriberId":-1211 } }, "State":"Active" }
{ "Id":"8a198b0d-f325-42c0-9de5-8449c646c195", "Template":{ "Metadata":[ { "Key":"Password", "Value":"test1234" }, { "Key":"Country", "Value":"US" }, { "Key":"Email", "Value":"[email protected]" }, { "Key":"First Name", "Value":"Jeff" }, { "Key":"LastName", "Value":"Brown" }, { "Key":"Address Line 1", "Value":"4051 Broad St" }, { "Key":"City", "Value":"San Luis Obispo" }, { "Key":"Postal Code", "Value":"93401" }, { "Key":"State", "Value":"CA" }, { "Key":"Preferred Location", "Value":"1" }, { "Key":"Index: Favorite Color", "Value":"6" } ] } }
{ "Id":"645b1b24-25c9-420c-96df-82652af0f2ea", "Created":"2015-07-24T15:38:17.951-07:00", "Modified":"2015-07-24T15:38:19.746-07:00", "Steps":[ { "Id":"8a198b0d-f325-42c0-9de5-8449c646c195", "Type":"CollectUserRegistrationMetadata", "Name":"User Registration Metadata Step", "Template":{ "Name":"User Registration Metadata Template", "Metadata":[ { "Key":"Password", "Value":"test1234", "Type":"Password", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"Address Line 1", "Value":"4051 Broad St", "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"Address Line 2", "Value":null, "Type":"String", "Rules":[ ], "Options":null }, { "Key":"City", "Value":"San Luis Obispo", "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"Email", "Value":"[email protected]", "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"First Name", "Value":"Jeff", "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"LastName", "Value":"Brown", "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"Postal Code", "Value":"93401", "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"State", "Value":"CA", "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":null }, { "Key":"Preferred Location", "Value":"1", "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":[ { "DisplayName":"Mile High Yoga", "Value":"1" } ] }, { "Key":"Index: Favorite Color", "Value":"6", "Type":"String", "Rules":[ { "Rule":"Required", "Value":"true" } ], "Options":[ { "DisplayName":"Green", "Value":"6" }, { "DisplayName":"Blue", "Value":"7" } ] } ] }, "Status":"Complete" } ], "Details":{ "Email":"[email protected]", "EmailVerified":false, "RegistrationOwnerUserId":null, "IdentityProviderType":"Mindbody", "IdentityProviderIdentifier":"", "Application":{ "Type":"MindbodySubscriberConsumer", "SubscriberId":-1211 } }, "State":"Completed" }