Link Search Menu Expand Document

Retrieving a user

Returns an OK code and a JSON for the user. A sample is shown below:

{ 
   "result":{ 
      "code":1,
      "status":"ok"
   },
   "results":{ 
      "user_info":{ 
         "id":123123,
         "user_id":123123,
         "authentication_point_identifier":"1055550795",
         "auxiliary_identifier":"pevau533xar",
         "first_name":"Foo",
         "last_name":"Bar",
         "country_code":"NL",
         "address_streetname":"Herengracht",
         "address_housenumber":"504",
         "address_housenumber_extension":"II",
         "address_line_2":"Grachtengordel",
         "address_line_3":"Centrum",
         "address_towncity":"Amsterdam",
         "address_regionstate":"Noord-Holland",
         "address_postalcode":"1017 CB",
         "lang_code":"en",
         "gender":"M",
         "birthday":"1900-01-30T00:00:00+00:00",
         "username":"foo@bar.com",
         "phone_number":"+31-220445641",
         "user_facebook_id":"321321",
         "user_facebook_access_token":"dAw2ISsd6asd67ASDLBJKd...",
         "mailing_list":{ 
            "mailing_list_sub_offered":true,
            "mailing_list_subscribed":false,
            "printed_mailing_list_subscribed":false
         },
         "entity_code":{ 
            "type":"regular",
            "code":"3593791"
         },
         "opt_in_programme":{ 
            "programme_opted_in":true,
            "join_date":"2019-06-06T08:06:14+00:00"
         },
         "registered":false,
         "is_employee": false,
         "loyalty_status":{ 
            "campaign_id":2095,
            "name":"Level 1",
            "description":"Level 1 in the Programme",
            "loyalty_level_id":2,
            "points_balance_current":220,
            "points_to_proceed_next_level":500,
            "points_to_remain_current_level":0,
            "last_review_date":"2019-04-04T00:05:22+00:00",
            "next_review_date":"2020-04-04T00:05:22+00:00",
            "date_reached":"2018-04-21T10:00:10+00:00"
         },
         "frequency":3,
         "recency":5,
         "monetary":2,
         "overall":532,
         "stores":null,
         "online_shopper":true,
         "offline_shopper":false,
         "average_basket_value":"119.30",
         "days_since_last_purchase":6,
         "number_of_purchases":4,
         "referring_user":{ 
            "id":4,
            "referral_code": "56uepf"
         },
         "referral_code" : "uyamct"
      },
      "result_type":"get-user"
   }
}

Overview

  • Call name: get-user
  • Endpoint URL: https://api0.spaaza.com/internal/get-user
  • Request methods: GET
  • Response Content-Type: application/json
  • Auth required: yes
  • X-MyPrice-App-Hostname header requirement: mandatory when using privileged authentication or when using the username parameter to look up a user with admin authentication

This API call retrieves information about an existing user.

HTTP Parameters

The following HTTP parameters can be passed to the API:

Parameter Description
chain_id The chain id to which the user is connected. In the case of admin authentication, this parameter can be used in conjunction with the user_id parameter to look up the user (or the username parameter can be used on its own to look up the user). If this parameter is used with admin authentication, the user_id parameter must also be supplied.
user_id The ID of the user. In the case of admin authentication, this parameter can be used in conjunction with the chain_id parameter to look up the user or the username parameter (or the username parameter can be used on its own to look up the user). If this parameter is used with admin authentication, the chain_id parameter must also be supplied.
username The username of the user in email address form. This parameter can be used to look up the user with either admin or privileged authentication. In the case of admin authentication, if this parameter is supplied, and the parameters user_id and chain_id have already been supplied, this parameter will not be used to look up the user. If this parameter is used to look up the user then the X-MyPrice-App-Hostname header is required.
authentication_point_identifier The ID of the user in a third party identity system such as webstore. If the user_id parameter has been supplied, this parameter will not be used to look up the user information. If the username parameter has also been supplied and has been unsuccessful in looking up a user, the authentication_point_identifier parameter will be used.
fb_access_token The Facebook access token of the user.
affiliate_code The affiliate code of the user.

Permissions

Admin authentication: the performing user needs to be logged in and have read access to the entity (business or chain) to which the user is connected.

Privileged authentication: the use of privileged authentication is permitted for this endpoint. This API endpoint allows delegated authentication.