Class: LoyaltyApIs::ProfileManagementApi
- Defined in:
- lib/loyalty_ap_is/apis/profile_management_api.rb
Overview
ProfileManagementApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#access_code(x_sso_market, authorization) ⇒ ApiResponse
This endpoint allows get the Access Code from /api/v2/auth/accessCode endpoint.
Methods inherited from BaseApi
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from LoyaltyApIs::BaseApi
Instance Method Details
#access_code(x_sso_market, authorization) ⇒ ApiResponse
This endpoint allows get the Access Code from /api/v2/auth/accessCode endpoint. Use the accessToken obtained using /api/v2/auth/exchangeAccessCode as Bearer in the Authorization header. language code (lower case) and country code (upper case), separated by a hyphen. For example: en-TH. Bearer {accessToken}. The value of accessToken is retrieved from the /auth/exchangeAccessCode endpoint.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/loyalty_ap_is/apis/profile_management_api.rb', line 20 def access_code(x_sso_market, ) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/api/v2/auth/accessCode', Server::SHELL) .header_param(new_parameter(x_sso_market, key: 'x-sso-market') .is_required(true)) .header_param(new_parameter(, key: 'Authorization') .is_required(true)) .header_param(new_parameter('application/json', key: 'accept'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(AccessCodeResponse.method(:from_hash)) .is_api_response(true) .local_error('401', 'Unauthorized', APIException) .local_error('500', 'Any unexpected error', JsonApiErrorException)) .execute end |