Threecolts Single Sign On (3C SSO) / API Callbacks / Get Account Info

Get Account Info

Version Change
v1.0 Initial version
v1.1 Payload fixes to match tests
v1.2 DB Structure changes and validations

Request: GET /sso/organizations/{ssoOrganizationId}/accounts/{ssoAccountId}

<v1.2>

{ssoOrganizationId} - integer - this will be a number which we need to match to hub_alpha>threecolts_organization>organization_id

{ssoAccountId} - integer - this will be a number which we need to match to hub_alpha>client>threecolts_account_id

If the account matches in the database but the hub_alpha>client>deleted is 1 then we treat it as missing.

</v1.2>

Gets an account.  The users array should return all users who have access to this account.

Еxample response:

{
  "product_account_id": "1234",
  "account_name": "Rodrigo",
  "created_at": "2016-04-18T11:23:39.000000Z",
  "users": [
    {
      "product_user_id": "3",
      "email": "rcastro@threecolts.com",
      "user_name": "tacticalarbitrage"|null,
      "first_name": "Rodrigo",
      "last_name": "Castro",
      "time_zone": "America/Chicago"|null,
      "external_login_type": "google"|null,
      "password": null,
      "created_at": "2016-04-18T11:23:39.000000Z",
      "is_account_owner": true|false,
      "is_organization_owner": true|false,
      "account_settings": {
        "account_type": {
          // for details in this object see
          // PUT /sso/organizations/{ssoOrganizationId}/accounts/{ssoAccountId}/users/{ssoUserId}/settings
          //These will be custom once we set it all up and determine with 3C what we need
        }
      }
    }
  ]
}
Key in response Value from field/hardcoded Extra info
product_account_id hub_alpha>client>id <v1.1>This must be a string in the payload.</v1.1>
account_name hub_alpha>client>clientName
created_at hub_alpha>client>date_created If null send current date. Use format: 2016-04-18T11:23:39.000000Z. This format for PHP is called ATOM
users Array of client_user that match the client>id with client_user>client_id
product_user_id hub_alpha>client_user>user_id <v1.1>This must be a string in the payload.</v1.1>
email hub_alpha>user>email Connection between user and client_user is by the field client_user>user.id and user.id
user_name hub_alpha>user>username <v1.2> Added value to the field. Default value is null and if empty or its length is < 3 we are to send null otherwise the value from the field </v1.2>
first_name hub_alpha>user>names Extract first name. Before first empty space
last_name hub_alpha>user>names All names if more than one. Except the first_name (refer above for how to select it)
time_zone hub_alpha>user>timezone <v1.2> Default value is UTC . Send the value from the database</v1.2>
external_login_type null <v1.1>Adding a null value</v1.1>
password hub_alpha>user>password <v1.1>Value is added</v1.1>
created_at hub_alpha>user>date_created If null send current date. Use format: 2016-04-18T11:23:39.000000Z. For PHP this is format ATOM
is_account_owner boolean <v1.1>This is the same as is_organization_owner</v1.1>
is_organization_owner boolean <v1.2>

For this we will check if the hub_alpha>client_user>user_id matches hub_alpha>threecolts_organization>organization_owner_id. If it matches it means true if it does not it means false.</v1.2> |

Returns 200 OK if found with body contents above.

Returns 404 if not found with blank body.

Is this article helpful?
0 0 0