Session

The end point /identity-service/session provides 4 methods for creation, validation, removing a session and changing session's context

Create session

POST /identity-service/session
Parameters
Name Type Description
username string Required: Username
password string Required: Password
Example Response. Account has been activated
{
  "current_participant": "urn:authenticateit:participant:841535075581481",
  "id": "urn:authenticateit:user:email:punchyrat@mailinator.com",
  "modules": [
    "product360",
    "reviews",
    "livechat",
    "rewards"
  ],
  "name": "Punch",
  "roles": [
    "contributors_moderator",
    "serialization_viewer",
    "security_admin",
    "supply_chain",
    "product_line",
    "newsline",
    "contributors_supervisor",
    "rewards_admin",
    "user"
  ],
  "ticket": "90fd184e-8a91-4a3b-abe5-106b7298e714"
}

If the user did not activate the account, he can resend activation email by token. Limit for resend activation email is 5.

Example Response. Account hasn't been activated
{
    "token": "65f5a461-111f-401c-8efc-2be0d305bb2d"
}

Validate session

GET /identity-service/session
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
  "current_participant": "urn:authenticateit:participant:841535075581481",
  "id": "urn:authenticateit:user:email:punchyrat@mailinator.com",
  "modules": [
    "product360",
    "reviews",
    "livechat",
    "rewards"
  ],
  "name": "Punch",
  "roles": [
    "contributors_moderator",
    "serialization_viewer",
    "security_admin",
    "supply_chain",
    "product_line",
    "newsline",
    "contributors_supervisor",
    "rewards_admin",
    "user"
  ],
  "ticket": "90fd184e-8a91-4a3b-abe5-106b7298e714"
}

Remove session

DELETE /identity-service/session
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket

Switch context

POST /identity-service/session/switch-context
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
new_participant string Required: Participant's id
Example Response
{
  "current_participant": "urn:authenticateit:participant:896865553032438",
  "participants": [
    {
      "address": "Lenina Str.",
      "city": "Some City",
      "company_prefix": [
        "0000026"
      ],
      "contact": "ContactName",
      "country": "020",
      "email": "foo@bar.ru",
      "facebook_url": "facebook.com/12345",
      "id": "urn:authenticateit:participant:841535075581481",
      "last_access": "2017-09-03T12:49:08Z",
      "logo": "http://dev-cdn.shping.com.s3.amazonaws.com/file2.png",
      "modules": [
        "product360",
        "reviews",
        "livechat",
        "rewards"
      ],
      "name": "ZippityElf",
      "parent": "urn:authenticateit:participant:1",
      "participant_type": [
        "product360"
      ],
      "phone": "+7919000000121",
      "post_code": "1234",
      "roles": [
        "user",
        "rewards_admin",
        "contributors_supervisor",
        "user",
        "newsline",
        "product_line",
        "supply_chain",
        "security_admin",
        "serialization_viewer",
        "contributors_moderator"
      ]
    }
  ]
}

Account

The end point /identity-service/account provides methods for creation and activation of account. Also it handles requests to retrieve current account information, delete and update the account.

User rating document

{
  "_id": "urn:authenticateit:user_levels",
  "description": [
    {
      "type": "basic",
      "name": "Basic",
      "coin_rate": 1,
      "icon": "http://dev-cdn.shping.com.s3.amazonaws.com/2017/5/24/391b0ab5-3866-4280-8f69-2be550eeafaa-Basic.png",
      "header": "Base level",
      "title": "Keep scanning new products to earn more points to level up!",
      "footer": "Normal coins per scan of any product",
      "earnings": [
        {
          "type": "scanning_partners",
          "coins": 5000000,
          "description": "Scanning a partners' product"
        },
        {
          "type": "adding_new",
          "coins": 4000000,
          "description": "Adding a new product"
        },
        {
          "type": "writing_review",
          "coins": 3000000,
          "description": "Writing a review"
        },
        {
          "type": "editing_product",
          "coins": 2000000,
          "description": "Editing product info"
        },
        {
          "type": "scan_product",
          "coins": 1000000,
          "description": "For scanning any product"
        }
      ],
      "activity": []
    },
    {
      "type": "bronze",
      "name": "Bronze",
      "coin_rate": 2,
      "header": "20 scans per month <br/>Maximum 20 days with no scans per month <br/>2 of linked Shping Buddies",
      "footer": "Earn 2 times more coins per scan of any product",
      "icon": "http://dev-cdn.shping.com.s3.amazonaws.com/2017/5/24/73984b1a-2c8a-4a9b-af6b-fdd95e80ffcf-Bronze.png",
      "title": "Keep scanning new products to earn more coins to level up!",
      "earnings": [
        {
          "type": "scanning_partners",
          "coins": 50,
          "description": "Scanning a partners' product"
        },
        {
          "type": "adding_new",
          "coins": 40,
          "description": "Adding a new product"
        },
        {
          "type": "writing_review",
          "coins": 30,
          "description": "Writing a review"
        },
        {
          "type": "editing_product",
          "coins": 20,
          "description": "Editing product info"
        },
        {
          "type": "scan_product",
          "coins": 10,
          "description": "For scanning any product"
        }
      ],
      "activity": [
        {
          "id": "unique_scans",
          "name": "Unique scans",
          "value": 20,
          "levelup_text": "You need to scan {} new products for the current month to level up!",
          "period": 1,
          "range": "month"
        },
        {
          "id": "number_of_days_with_no_scans",
          "name": "Days with no scans",
          "value": 20,
          "levelup_text": "Keep scanning to earn more!",
          "period": 1,
          "range": "month"
        },
        {
          "id": "buddies",
          "name": "Active Shping Buddies",
          "value": 2,
          "levelup_text": "You need to add {} buddies to your Shping Buddies list."
        }
      ]
    },
    {
      "type": "silver",
      "name": "Silver",
      "icon": "http://dev-cdn.shping.com.s3.amazonaws.com/2017/5/24/367ada03-2293-4825-bce9-87e7a0e0f5ad-Silver.png",
      "coin_rate": 3,
      "header": "80 scans per month <br/>Maximum 15 days with no scans per month <br/>5 of linked Shping Buddies",
      "footer": "Earn 3 times more coins per scan of any product",
      "title": "Keep scanning new products to earn more coins to level up!",
      "earnings": [
        {
          "type": "scanning_partners",
          "coins": 50,
          "description": "Scanning a partners' product"
        },
        {
          "type": "adding_new",
          "coins": 40,
          "description": "Adding a new product"
        },
        {
          "type": "writing_review",
          "coins": 30,
          "description": "Writing a review"
        },
        {
          "type": "editing_product",
          "coins": 20,
          "description": "Editing product info"
        },
        {
          "type": "scan_product",
          "coins": 10,
          "description": "For scanning any product"
        }
      ],
      "activity": [
        {
          "id": "unique_scans",
          "name": "Unique scans",
          "value": 80,
          "levelup_text": "You need to scan {} new products for the current month to level up!",
          "period": 1,
          "range": "month"
        },
        {
          "id": "number_of_days_with_no_scans",
          "name": "Days with no scans",
          "value": 15,
          "levelup_text": "Keep scanning to earn more!",
          "period": 1,
          "range": "month"
        },
        {
          "id": "buddies",
          "name": "Active Shping Buddies",
          "value": 5,
          "description": "5 of linked Shping Buddies",
          "levelup_text": "You need to add {} buddies to your Shping Buddies list."
        }
      ]
    },
    {
      "type": "gold",
      "name": "Gold",
      "coin_rate": 5,
      "header": "200 scans per month <br/>Maximum 10 days with no scans per month <br/>10 of linked Shping Buddies",
      "footer": "Earn 5 times more coins per scan of any product",
      "icon": "http://dev-cdn.shping.com.s3.amazonaws.com/2017/5/24/3000fddb-c2c2-4bac-b84d-51f52f3c239b-Gold.png",
      "title": "Keep scanning new products to earn more coins to level up!",
      "earnings": [
        {
          "type": "scanning_partners",
          "coins": 50,
          "description": "Scanning a partners' product"
        },
        {
          "type": "adding_new",
          "coins": 40,
          "description": "Adding a new product"
        },
        {
          "type": "writing_review",
          "coins": 30,
          "description": "Writing a review"
        },
        {
          "type": "editing_product",
          "coins": 20,
          "description": "Editing product info"
        },
        {
          "type": "scan_product",
          "coins": 10,
          "description": "For scanning any product"
        }
      ],
      "activity": [
        {
          "id": "unique_scans",
          "value": 200,
          "levelup_text": "You need to scan {} new products for the current month to level up!",
          "period": 1,
          "range": "month"
        },
        {
          "id": "number_of_days_with_no_scans",
          "name": "Days with no scans",
          "value": 10,
          "levelup_text": "Keep scanning to earn more!",
          "period": 1,
          "range": "month"
        },
        {
          "id": "buddies",
          "name": "Active Shping Buddies",
          "value": 10,
          "description": "10 of linked Shping Buddies",
          "levelup_text": "You need to add {} buddies to your Shping Buddies list."
        }
      ]
    },
    {
      "type": "platinum",
      "coin_rate": 10,
      "header": "300 scans per month <br/>Maximum 5 days with no scans per month <br/>30 of linked Shping Buddies",
      "footer": "Earn 10 times more coins per scan of any product",
      "icon": "http://dev-cdn.shping.com.s3.amazonaws.com/2017/5/24/d37edf9d-6faa-43c4-915c-a414b8547f75-Platinum.png",
      "name": "Platinum",
      "title": "Keep scanning new products to earn more coins!",
      "earnings": [
        {
          "type": "scanning_partners",
          "coins": 50,
          "description": "Scanning a partners' product"
        },
        {
          "type": "adding_new",
          "coins": 40,
          "description": "Adding a new product"
        },
        {
          "type": "writing_review",
          "coins": 30,
          "description": "Writing a review"
        },
        {
          "type": "editing_product",
          "coins": 20,
          "description": "Editing product info"
        },
        {
          "type": "scan_product",
          "coins": 10,
          "description": "For scanning any product"
        }
      ],
      "activity": [
        {
          "id": "unique_scans",
          "name": "Unique scans",
          "value": 300,
          "period": 1,
          "levelup_text": "You need to scan {} new products for the current month to level up!",
          "range": "month"
        },
        {
          "id": "number_of_days_with_no_scans",
          "name": "Days with no scans",
          "value": 5,
          "levelup_text": "Keep scanning to earn more!",
          "period": 1,
          "range": "month"
        },
        {
          "id": "buddies",
          "name": "Active Shping Buddies",
          "value": 30,
          "levelup_text": "You need to add {} buddies to your Shping Buddies list."
        }
      ]
    }
  ],
  "type": "system_doc"
}

Resend activation email

POST /identity-service/account/code/resend
Parameters
Name Type Description
token string Required: Activation token

Delete stripe token

DELETE /identity-service/account/customer/
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
  "address2": "",
  "city": "Izhevsk",
  "email": "some_email@gmail.com",
  "first_name": "First Name",
  "id": "urn:authenticateit:user:email:some_email@gmail.com",
  "language": "en",
  "last_name": "Last Name",
  "participants": [
    {
      "id": "urn:authenticateit:participant:841535075581481",
      "last_access": "2017-06-13T10:21:26Z",
      "name": "ZippityElf",
      "roles": [
        "rewards_admin",
        "contributors_supervisor",
        "user",
        "newsline",
        "product_line",
        "supply_chain",
        "security_admin",
        "serialization_viewer",
        "contributors_moderator"
      ]
    },
    {
      "id": "urn:authenticateit:participant:00000000000048",
      "last_access": "2017-05-23T08:05:09Z",
      "name": "Maria360",
      "roles": [
        "security_admin",
        "newsline",
        "user",
        "contributors_supervisor",
        "rewards_admin"
      ]
    }
  ],
  "phone": "+61400000000",
  "coins": 53
}

Request for add or replace new device

POST /identity-service/set_device_id/
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
channel string Required for baidu
id string Device id
type string Device type (apns, apns_sandbox, gcm or baidu)
old_id string Old device ID (which must be replaced)
old_channel string Old channel (which must be replaced) (optional)

Request for remove device

POST /identity-service/remove_device_id/
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
channel string Optional
id string Device id

Nominate user to participant

POST /identity-service/nominate
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string User's id
current_participant string User's current participant
role array::string User's roles

Denominate user roles

POST /identity-service/nominate/delete
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string User's id
current_participant string User's current participant
role array::string User's roles
Example Response

The response contains an updated list of roles. If response is empty - then participant was success deleted from the user.

{
  "id": "urn:authenticateit:participant:1489226097599",
  "name": "Test Manufacturer 1489226097599",
  "roles": [
    "serialization_viewer",
    "supply_chain",
    "product_line"
  ]
}

Create new account

POST /identity-service/account
Parameters
Name Type Description
email string Required Correct email, maxlength 100
password string Required Password; minlength 5
first_name string First name; maxlength 100
last_name string Last name; maxlength 100
phone string Phone number in international format without any spaces
language string ISO 639-1 language code (en,ru...)
post_code string Post code; minlength 3, maxlength 10
city string City; maxlength 100
address1 string First address's line; maxlength 200
address2 string Second address's line; maxlength 200
birthdate string Birthdate in ISO 8601 format (1970-01-01)
gender string Gender (male or female)
photo string Photo in project's S3 bucket
job_title string Job title
Example Response
{
  "email": "foo@bar.com",
  "first_name": "First Name",
  "last_name": "Last Name",
  "phone": "+61400000000",
  "language": "en",
  "post_code": "3004",
  "city": "Melbourne",
  "address1": "10 Queens Rd",
  "birthdate": "1970-01-01",
  "gender": "male",
  "photo": "http://google.com/image.png",
  "job_title": "Manager"
}

Activate account

GET /identity-service/account/activate/:activation_code
Example Response
{
  "email": "foo@bar.com",
  "first_name": "First Name",
  "last_name": "Last Name",
  "phone": "+61400000000",
  "language": "en",
  "post_code": "3004",
  "city": "Melbourne",
  "address1": "10 Queens Rd",
  "birthdate": "1970-01-01",
  "gender": "male",
  "photo": "http://google.com/image.png"
}

Send verification SMS

Send SMS message with verification code to user's phone number. Does nothing if there is no phone number in user profile.

POST /identity-service/account/verifications/phone
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket

Verify user's phone number

Verify user's phone number. If provided code matches code sent in SMS message, phone number status will be updated. Responds with updated user profile, if phone status updated.

GET /identity-service/account/verifications/phone/:code
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
  "email": "foo@bar.com",
  "first_name": "First Name",
  "last_name": "Last Name",
  "phone": "+61400000000",
  "language": "en",
  "post_code": "3004",
  "city": "Melbourne",
  "address1": "10 Queens Rd",
  "birthdate": "1970-01-01",
  "gender": "male",
  "photo": "http://google.com/image.png"
}

Get information from my profile

GET /identity-service/account
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
  "email": "foo@bar.com",
  "first_name": "First Name",
  "last_name": "Last Name",
  "phone": "+61400000000",
  "language": "en",
  "post_code": "3004",
  "city": "Melbourne",
  "address1": "10 Queens Rd",
  "birthdate": "1970-01-01",
  "gender": "male",
  "photo": "http://google.com/image.png",
  "job_title": "Manager",
  "participants": [
        {
            "company_prefix": [
                "*"
            ],
            "id": "urn:authenticateit:participant:1",
            "last_access": "2017-12-14T18:27:36Z",
            "last_access_user": {
                "first_access": false,
                "ts": "2017-12-14T18:27:36Z"
            },
            "modules": [
                "todo_cards",
                "product360",
                "reviews",
                "livechat",
                "rewards"
            ],
            "name": "Authenticateit Pty Ltd",
            "participant_type": [
                "system"
            ],
            "roles": [
                "contributors_moderator",
                "newsline",
                "product_line",
                "rewards_admin",
                "security_admin",
                "serialization_viewer",
                "supply_chain",
                "user"
            ]
        }
    ]
}

Delete my account

Will delete user account and active session. User wouldn't be able to perform any requests to the API after this request.

DELETE /identity-service/account
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket

Update my account

Update account information and return up to date representation of the account. Allows to modify name, password and language fields. All fields are optional in the request. To change password (password field present in the request), current password must be provided in old_password field.

PUT /identity-service/account
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
email string Correct email, maxlength 100
password string Password; minlength 5
old_password string Current password, required if changing password
first_name string First name; maxlength 100
last_name string Last name; maxlength 100
phone string Phone number in international format without any spaces
language string ISO 639-1 language code (en,ru...)
post_code string Post code; minlength 3, maxlength 10
city string City; maxlength 100
address1 string First address's line; maxlength 200
address2 string Second address's line; maxlength 200
birthdate string Birthdate in ISO 8601 format (1970-01-01)
gender string Gender (male or female)
photo string Photo in project's S3 bucket
Example Response
{
 "email": "foo@bar.com",
  "first_name": "First Name",
  "last_name": "Last Name",
  "phone": "+61400000000",
  "language": "en",
  "post_code": "3004",
  "city": "Melbourne",
  "address1": "10 Queens Rd",
  "birthdate": "1970-01-01",
  "gender": "male",
  "photo": "http://google.com/image.png"
}

Reset password

Send email with restore code
POST /identity-service/account/restore
Parameters
Name Type Description
email string Required: User's email
Example Response
"Mail has been send"
Reset password
POST /identity-service/account/restore/:code
Parameters
Name Type Description
password string Required: New password
Example Response
{
  "email": "foo@bar.com",
  "first_name": "RootUser",
  "id": "urn:authenticateit:user:email:foo@bar.com",
  "language": "en",
  "participants": [
    {
      "id": "urn:authenticateit:participant:9489226097599",
      "last_access": "2017-04-14T05:02:34Z",
      "name": "Test Partner 1491799727959",
      "roles": [
        "rewards_admin",
        "serialization_viewer",
        "security_admin",
        "supply_chain",
        "product_line",
        "newsline"
      ]
    },
    {
      "id": "urn:authenticateit:participant:1491850314517",
      "last_access": "2017-04-12T17:43:32Z",
      "name": "Test Manufacturer 1491850314517",
      "roles": [
        "rewards_admin",
        "serialization_viewer",
        "security_admin",
        "supply_chain",
        "product_line",
        "newsline"
      ]
    }
  ],
  "coins": 30
}

Request for check user by email

POST /identity-service/account/check
Parameters
Name Type Description
email string Required: User's email
Example Response
{
  "first_name": "Name",
  "last_name": "LastName"
}

Get user level

GET /identity-service/account/level
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
[
  {
    "current": false,
    "footer": "Normal coins per any product scan",
    "header": "Base level",
    "icon": "http://dev-cdn.shping.com.s3.amazonaws.com/2017/5/24/391b0ab5-3866-4280-8f69-2be550eeafaa-Basic.png",
    "name": "Basic",
    "coin_rate": 1,
    "short_description": "Scan more products and earn more!",
    "title": "Keep scanning new products to earn more coins to level up!",
    "type": "basic"
  },
  {
    "current": true,
    "current_percentages": 66,
    "footer": "Earn 2 times more coins per product scan",
    "header": "20 scans per month <br/>Maximum 20 days with no scans per month <br/>2 of linked Shping Buddies",
    "icon": "http://dev-cdn.shping.com.s3.amazonaws.com/2017/5/24/73984b1a-2c8a-4a9b-af6b-fdd95e80ffcf-Bronze.png",
    "max_percentages": 100,
    "name": "Bronze",
    "coin_rate": 2,
    "short_description": "Scan more products and earn 2x more!",
    "title": "Keep scanning new products to earn more coins to level up!",
    "todo": [
      "You need to scan 27 new products for the current month to level up!"
    ],
    "type": "bronze"
  },
  {
    "current": false,
    "footer": "Earn 3 times more coins per product scan",
    "header": "80 scans per month <br/>Maximum 15 days with no scans per month <br/>5 of linked Shping Buddies",
    "icon": "http://dev-cdn.shping.com.s3.amazonaws.com/2017/5/24/367ada03-2293-4825-bce9-87e7a0e0f5ad-Silver.png",
    "name": "Silver",
    "coin_rate": 3,
    "short_description": "Scan more products and earn 3x more!",
    "title": "Keep scanning new products to earn more coins to level up!",
    "type": "silver"
  },
  {
    "current": false,
    "footer": "Earn 5 times more coins per product scan",
    "header": "200 scans per month <br/>Maximum 10 days with no scans per month <br/>10 of linked Shping Buddies",
    "icon": "http://dev-cdn.shping.com.s3.amazonaws.com/2017/5/24/3000fddb-c2c2-4bac-b84d-51f52f3c239b-Gold.png",
    "name": "Gold",
    "coin_rate": 5,
    "short_description": "Scan more products and earn 5x more!",
    "title": "Keep scanning new products to earn more coins to level up!",
    "type": "gold"
  },
  {
    "current": false,
    "footer": "Earn 10 times more coins per product scan",
    "header": "300 scans per month <br/>Maximum 5 days with no scans per month <br/>30 of linked Shping Buddies",
    "icon": "http://dev-cdn.shping.com.s3.amazonaws.com/2017/5/24/d37edf9d-6faa-43c4-915c-a414b8547f75-Platinum.png",
    "name": "Platinum",
    "coin_rate": 10,
    "short_description": "Scan more products and earn 10x more!",
    "title": "Keep scanning new products to earn more platinum!",
    "type": "platinum"
  }
]

Get earnings info

GET /identity-service/account/earnings
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
  "level_logo": "http://dev-cdn.shping.com.s3.amazonaws.com/2017/5/24/391b0ab5-3866-4280-8f69-2be550eeafaa-Basic.png",
  "level_name": "Basic",
  "level_type": "basic",
  "list": [
    {
      "description": "Scanning a partners' product",
      "coins": 50,
      "type": "scanning_partners"
    },
    {
      "description": "Adding a new product",
      "coins": 40,
      "type": "adding_new"
    },
    {
      "description": "Writing a review",
      "coins": 30,
      "type": "writing_review"
    },
    {
      "description": "Editing product info",
      "coins": 20,
      "type": "editing_product"
    },
    {
      "description": "For scanning any product",
      "coins": 10,
      "type": "scan_product"
    }
  ]
}

Brand Unlock and Participant Registration

User account registration process may include participant registration and brand unlock. If the process is sucessfull, a participant will be created and registered user will be nominated to represent the participant. Unowned brand will be assigned to the participant.

Additional account field pending_participant may be provided in POST /account request. It must be an object with the following fields: company_prefix (GTIN prefix of a company user is representing), name (participant name), brand_name (identifier of unowned brand user is representing), participant_type (currently only product360 is allowed here). The response will include pending_participant object field.

If there is technical email address associated with the company prefix, account activation email will be sent to the technical email address. Field tech_email_used in pending_participant response field will be true in this case.

After activating the account, user should continue participant registration process and must provide all the missing fields in the body of PUT /account/pending_participant request. Field names are the same as in POST /account request. Also there is additional required field country (country of participant). Performing the PUT request will finish participant registration process and pending_participant field will be removed from the account.

If brand technical email was used for account activation, participant will be created right away, user will be nominated a product_line role (in case of product360 participant), created participant will be made owner of previously unowned brand identified with brand_name.

If there was no brand technical email address associated with the company prefix (this actually is the case for now), information on pending participant will be emailed to a moderator who will either approve or reject participant registration by clicking on approve/reject links. URLs to approve or reject pending participant registration are /pending_participant/:code/approve and /pending_participant/:code/reject.

System user may retrieve pending participant registration code by sending user account identifier as id field in POST /account/pending_participant/get_code. This API is mainly for automated testing purposes. Retrieved code may be used to approve/reject pending participant registration with the corresponding URLs.

Company registration flow

Rejecting pending participant

POST /identity-service/pending_participant/reject
Parameters
Name Type Description
code string Required: “708788a0-5b1b-46df-8279-2e6c18f58a0d”
reason string “Text Reason”

Account facebook

Settings

[{"facebook", 
         {"https://graph.facebook.com/me", 
            [
             {<<"id">>,<<"id">>},     
             {<<"name">>,<<"name">>},
             {<<"email">>,<<"email">>},
             {<<"age">>,<<"age_range">>},
             {<<"birthday">>,<<"birthday">>},
             {<<"timezone">>,<<"timezone">>},
             {<<"languages">>,<<"languages">>},
             {<<"locale">>,<<"locale">>}
            ]
          }
  }
]
[{<name of service>, 
         {<service uri>, (https://graph.facebook.com/me) 
            [
             <map of profile field>, <service field>
            ]
          }
  }
]

The end point /identity-service/account/oauth provides 1 method:

Create account via facebook API

POST /identity-service/account/oauth
Parameters
Name Type Description
content-type:application/x-www-form-urlencoded header Required: Content type
service=facebook&token=:token url Required: service=facebook&token=EAACZAnXC7MnABADtaNyYitype

The token can be obtained at https://developers.facebook.com/tools/explorer/

Example Response
{
  "name": "Ivan Vasilev",
  "roles": [
    "user"
  ],
  "ticket": "EAACZAnXC7MnABADtaNyYi"
}
Errors
{error: "<service> contains unavailable value"}
{error: "Can't read profile by token"}
{error: "Invalid json data from host"}
{error: "Token not found"}
{error: "Oauth server is not available"}
{error: "Internal server error"}
{error: "Cant read data for fill profile"}
Example of document in CuchDB
{
  "_id": "115317188939815",
  "_rev": "60-85eaa22ff5dd0124202452468d9b3eca",
  "age": {
    "min": 21
  },
  "birthday": "07/01/1990",
  "email": "foo@bar.com",
  "languages": "",
  "locale": "ru_RU",
  "name": "Some Name",
  "roles": [
    "user"
  ],
  "service": "facebook",
  "timezone": 4,
  "type": "user"
}

Read user's country from ip

GET /identity-service/current_country
Parameters
Name Type Description
content-type:application/x-www-form-urlencoded header Required: Content type
Example Response
{
    "alpha2": "RU",
    "alpha3": "RUS",
    "iso": "643",
    "name": "Russian Federation",
    "name_ru": "Российская Федерация",
    "name_zh": "俄罗斯联邦",
    "type": "matched"
}

results matching ""

    No results matching ""