Example User Profiles Code

For context and information about the API, see User Profiles.

Basic flow:

Login

Create a Profile

Change Profile Property Values

See the Updated Profile

Link a Profile to Users

Login

Example login request

<soapenv:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<soapenv:Header/>

<soapenv:Body>

  <bir:Login>

    <!--Optional:-->

    <bir:username>user@birst.com</bir:username>

    <!--Optional:-->  

    <bir:password>userPassword</bir:password>

  </bir:Login>

</soapenv:Body>

</soapenv:Envelope>

Example response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" ...   >

<soap:Body>

  <LoginResponse xmlns="http:www.birst.com/">

    <LoginResult>e6d59ce72e99137324922c703ece67c6</LoginResult>

  </LoginResponse>

</soap:Body>

</soap:Envelope>

Create a Profile

Request a new profile with default properties

<soapenv:Envelope

xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" ...>

<soapenv:Header/>

<soapenv:Body>

    <bir:createProfile>

      <!--Optional:-->

      <bir:token>e6d59ce72e99137324922c703ece67c6</bir:token>

      <!--Optional:-->

      <bir:name>MyWhiteLabelingProfile</bir:name>

      <!--Optional:-->

      <bir:description>This is my profile</bir:description>

  </bir:createProfile>

</soapenv:Body>

</soapenv:Envelope>

 

Example response with default properties

<soap:Envelope

xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" ....   >

<soap:Body>

 <createProfileResponse xmlns="http://www.birst.com/">

  <createProfileResult>

   <id>412</id>

   <name>MyWhiteLabelingProfile</name>

   <description>This is my profile</description>

   <isDefault>False</isDefault>

   <properties>

    <ProfileProperty>

     <name>INTERACTIVE_LOGIN</name>

     <value>1</value>

     <locale>en_US</locale>

    </ProfileProperty>

    <ProfileProperty>

     <name>PASSWORD_RESET</name>

     <value>1</value>

     <locale>en_US</locale>

    </ProfileProperty>

    <ProfileProperty>

     <name>SUPPORT_URL</name>

     <value>/Support.aspx</value>

     <locale>en_US</locale>

    </ProfileProperty>

    <ProfileProperty>

     <name>CONTACT_US_URL</name>

     <value>http://www.birst.com/company/contact</value>

     <locale>en_US</locale>

    </ProfileProperty>

    <ProfileProperty>

     <name>HELP_URL</name>

     <value>/Help/Full/index.htm</value>

     <locale>en_US</locale>

    </ProfileProperty>

    <ProfileProperty>

     <name>LOGO_PATH</name>

     <value/>

     <locale>en_US</locale>

    </ProfileProperty>

    <ProfileProperty>

     <name>COPYRIGHT_TEXT</name>

     <value>Copyright (c) 2008-2014 Birst. All rights reserved.</value>

     <locale>en_US</locale>

    </ProfileProperty>

    <ProfileProperty>

     <name>ERROR_URL</name>

     <value/>

     <locale>en_US</locale>

    </ProfileProperty>

    <ProfileProperty>

     <name>TERMS_OF_SERVICE_URL</name>

     <value>http://www.birst.com/terms-of-service</value>

     <locale>en_US</locale>

    </ProfileProperty>

    <ProfileProperty>

     <name>PRIVACY_POLICY_URL</name>

     <value>http://www.birst.com/privacy-policy</value>

     <locale>en_US</locale>

    </ProfileProperty>

    <ProfileProperty>

      <name>SECURITY_REPORTING_URL</name>

      <value>http://www.birst.com/security-reporting</value>

      <locale>en_US</locale>

    </ProfileProperty>

    <ProfileProperty>

     <name>PAGE_TITLE</name>

     <value>Birst</value>

     <locale>en_US</locale>

    </ProfileProperty>

    <ProfileProperty>

     <name>FAVICON_ICON</name>

     <value/>

     <locale>en_US</locale>

    </ProfileProperty>

    <ProfileProperty>

     <name>LOGOUT_URL</name>

     <value>~/Login.aspx</value>

     <locale>en_US</locale>

    </ProfileProperty>

    <ProfileProperty>

     <name>THEME_NAME</name>

     <value>NO_THEME</value>

     <locale>en_US</locale>

    </ProfileProperty>

    </properties>

  </createProfileResult>

 </createProfileResponse>

</soap:Body>

</soap:Envelope>

Change Profile Property Values

In the SOAP body, update the profile property

  <bir:setProfileProperty>

    <!--Optional:-->

    <bir:token>e6d59ce72e99137324922c703ece67c6</bir:token>

    <!--Optional:-->

    <bir:profileID>412</bir:profileID>

    <!--Optional:-->

    <bir:property>userPassword</bir:description>

      <!--Optional:-->

      <bir:name>HELP_URL</bir:name>

      <!--Optional:-->

      <bir:value>http:www.birst.com</bir:value>

      <!--Optional:-->

      <bir:locale>en_US</bir:locale>

    </bir:property>

</bir:setProfileProperty>

Example response

<soap:Envelope

xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" ...  ">

<soap:Body>

  <setProfilePropertyResponse xmlns="http://www.birst.com/"/>

</soap:Body>

</soap:Envelope>

 

See the Updated Profile

In the SOAP body, call getProfileDetails

  <bir:getProfileDetails>

     <!--Optional:-->

      <bir:token>e6d59ce72e99137324922c703ece67c6</bir:token>

      <!--Optional:-->

      <bir:profileID>412</bir:profileID>

  </bir:getProfileDetails>

The result shows the entire profile. Confirm that your changes are as you expect.

Link a Profile to Users

In the SOAP body, call linkProfileToUsers

Set UserProfileMapping for each user.

Tip: To assign a profile to all users of an account at once, use linkProfileToAccount.

  <bir:linkProfileToUsers>

     <!--Optional:-->

      <bir:token>e6d59ce72e99137324922c703ece67c6</bir:token>

      <!--Optional:-->

      <bir:userProfileList>

        <!--Zero or more repetitions:-->

        <bir:UserProfileMapping>

         <!--Optional:-->

         <bir:userName>email@domain.com</bir:userName>

         <!--Optional:-->

         <bir:profileID>412</bir:profileID>

      </bir:UserProfileMapping>

     </bir:userProfileList>

  </bir:linkProfileToUsers>