login_radius 3.0.0 → 10.0.0.pre.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE.txt +21 -0
  3. data/README.md +58 -52
  4. data/lib/login_radius.rb +30 -15
  5. data/lib/login_radius/api/account/account_api.rb +581 -0
  6. data/lib/login_radius/api/account/role_api.rb +330 -0
  7. data/lib/login_radius/api/account/sott_api.rb +47 -0
  8. data/lib/login_radius/api/advanced/configuration_api.rb +57 -0
  9. data/lib/login_radius/api/advanced/consent_management_api.rb +161 -0
  10. data/lib/login_radius/api/advanced/custom_object_api.rb +316 -0
  11. data/lib/login_radius/api/advanced/custom_registration_data_api.rb +195 -0
  12. data/lib/login_radius/api/advanced/multi_factor_authentication_api.rb +606 -0
  13. data/lib/login_radius/api/advanced/re_authentication_api.rb +243 -0
  14. data/lib/login_radius/api/advanced/web_hook_api.rb +101 -0
  15. data/lib/login_radius/api/authentication/authentication_api.rb +986 -0
  16. data/lib/login_radius/api/authentication/one_touch_login_api.rb +160 -0
  17. data/lib/login_radius/api/authentication/password_less_login_api.rb +158 -0
  18. data/lib/login_radius/api/authentication/phone_authentication_api.rb +329 -0
  19. data/lib/login_radius/api/authentication/pin_authentication_api.rb +316 -0
  20. data/lib/login_radius/api/authentication/risk_based_authentication_api.rb +286 -0
  21. data/lib/login_radius/api/authentication/smart_login_api.rb +146 -0
  22. data/lib/login_radius/api/social/native_social_api.rb +193 -0
  23. data/lib/login_radius/api/social/social_api.rb +802 -0
  24. data/lib/login_radius/error.rb +7 -0
  25. data/lib/login_radius/request_client.rb +295 -0
  26. data/lib/login_radius/response.rb +12 -0
  27. data/lib/login_radius/version.rb +3 -3
  28. data/login_radius.gemspec +36 -0
  29. metadata +61 -20
  30. data/LICENSE +0 -22
  31. data/lib/hash.rb +0 -12
  32. data/lib/login_radius/advanced_api.rb +0 -133
  33. data/lib/login_radius/authentication_api.rb +0 -597
  34. data/lib/login_radius/exception.rb +0 -4
  35. data/lib/login_radius/management_api.rb +0 -327
  36. data/lib/login_radius/rest_request.rb +0 -142
  37. data/lib/login_radius/social_api.rb +0 -402
  38. data/lib/login_radius/two_fa_api.rb +0 -191
  39. data/lib/string.rb +0 -8
@@ -0,0 +1,146 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Created by LoginRadius Development Team
4
+ # Copyright 2019 LoginRadius Inc. All rights reserved.
5
+ require_relative '../../request_client'
6
+
7
+ module LoginRadius
8
+ # SmartLoginApi module
9
+ class SmartLoginApi
10
+ include RequestClient
11
+
12
+ attr_accessor :site_name, :api_key, :api_secret
13
+
14
+ # Initializes a LoginRadius Account object with an apikey and secret
15
+ # Takes in a hash containing site_name(required), api_key(required), api_secret(required)
16
+ def initialize
17
+ @site_name = ENV['SITE_NAME']
18
+ @api_key = ENV['API_KEY']
19
+ @api_secret = ENV['API_SECRET']
20
+ raise LoginRadius::Error.new, "'site_name' is a required option for Account class initialization." \
21
+ unless @site_name != '' && @site_name != nil
22
+ raise LoginRadius::Error.new, "'api_key' is a required option for Account class initialization." \
23
+ unless @api_key != '' && @api_key != nil
24
+ raise LoginRadius::Error.new, "'api_secret is a required option for Account class initialization." \
25
+ unless @api_secret != '' && @api_secret != nil
26
+ end
27
+
28
+ # This API verifies the provided token for Smart Login
29
+ #
30
+ # @param verification_token - Verification token received in the email
31
+ # @param welcome_email_template - Name of the welcome email template
32
+ #
33
+ # @return Complete verified response data
34
+ # 8.4.1
35
+ def smart_login_token_verification(verification_token, welcome_email_template = '')
36
+ if isNullOrWhiteSpace(verification_token)
37
+ raise LoginRadius::Error.new, getValidationMessage('verification_token')
38
+ end
39
+
40
+ query_parameters = {}
41
+ query_parameters['apiKey'] = @api_key
42
+ query_parameters['verificationToken'] = verification_token
43
+ unless isNullOrWhiteSpace(welcome_email_template)
44
+ query_parameters['welcomeEmailTemplate'] = welcome_email_template
45
+ end
46
+
47
+ resource_path = 'identity/v2/auth/email/smartlogin'
48
+ get_request(resource_path, query_parameters, nil)
49
+ end
50
+
51
+ # This API sends a Smart Login link to the user's Email Id.
52
+ #
53
+ # @param client_guid - Unique string used in the Smart Login request
54
+ # @param email - Email of the user
55
+ # @param redirect_url - Url where the user will redirect after success authentication
56
+ # @param smart_login_email_template - Email template for Smart Login link
57
+ # @param welcome_email_template - Name of the welcome email template
58
+ #
59
+ # @return Response containing Definition of Complete Validation data
60
+ # 9.17.1
61
+ def smart_login_by_email(client_guid, email, redirect_url = '', smart_login_email_template = '', welcome_email_template = '')
62
+ if isNullOrWhiteSpace(client_guid)
63
+ raise LoginRadius::Error.new, getValidationMessage('client_guid')
64
+ end
65
+ if isNullOrWhiteSpace(email)
66
+ raise LoginRadius::Error.new, getValidationMessage('email')
67
+ end
68
+
69
+ query_parameters = {}
70
+ query_parameters['apiKey'] = @api_key
71
+ query_parameters['clientGuid'] = client_guid
72
+ query_parameters['email'] = email
73
+ unless isNullOrWhiteSpace(redirect_url)
74
+ query_parameters['redirectUrl'] = redirect_url
75
+ end
76
+ unless isNullOrWhiteSpace(smart_login_email_template)
77
+ query_parameters['smartLoginEmailTemplate'] = smart_login_email_template
78
+ end
79
+ unless isNullOrWhiteSpace(welcome_email_template)
80
+ query_parameters['welcomeEmailTemplate'] = welcome_email_template
81
+ end
82
+
83
+ resource_path = 'identity/v2/auth/login/smartlogin'
84
+ get_request(resource_path, query_parameters, nil)
85
+ end
86
+
87
+ # This API sends a Smart Login link to the user's Email Id.
88
+ #
89
+ # @param client_guid - Unique string used in the Smart Login request
90
+ # @param username - UserName of the user
91
+ # @param redirect_url - Url where the user will redirect after success authentication
92
+ # @param smart_login_email_template - Email template for Smart Login link
93
+ # @param welcome_email_template - Name of the welcome email template
94
+ #
95
+ # @return Response containing Definition of Complete Validation data
96
+ # 9.17.2
97
+ def smart_login_by_user_name(client_guid, username, redirect_url = '', smart_login_email_template = '', welcome_email_template = '')
98
+ if isNullOrWhiteSpace(client_guid)
99
+ raise LoginRadius::Error.new, getValidationMessage('client_guid')
100
+ end
101
+ if isNullOrWhiteSpace(username)
102
+ raise LoginRadius::Error.new, getValidationMessage('username')
103
+ end
104
+
105
+ query_parameters = {}
106
+ query_parameters['apiKey'] = @api_key
107
+ query_parameters['clientGuid'] = client_guid
108
+ query_parameters['username'] = username
109
+ unless isNullOrWhiteSpace(redirect_url)
110
+ query_parameters['redirectUrl'] = redirect_url
111
+ end
112
+ unless isNullOrWhiteSpace(smart_login_email_template)
113
+ query_parameters['smartLoginEmailTemplate'] = smart_login_email_template
114
+ end
115
+ unless isNullOrWhiteSpace(welcome_email_template)
116
+ query_parameters['welcomeEmailTemplate'] = welcome_email_template
117
+ end
118
+
119
+ resource_path = 'identity/v2/auth/login/smartlogin'
120
+ get_request(resource_path, query_parameters, nil)
121
+ end
122
+
123
+ # This API is used to check if the Smart Login link has been clicked or not
124
+ #
125
+ # @param client_guid - Unique string used in the Smart Login request
126
+ # @param fields - The fields parameter filters the API response so that the response only includes a specific set of fields
127
+ #
128
+ # @return Response containing User Profile Data and access token
129
+ # 9.21.1
130
+ def smart_login_ping(client_guid, fields = '')
131
+ if isNullOrWhiteSpace(client_guid)
132
+ raise LoginRadius::Error.new, getValidationMessage('client_guid')
133
+ end
134
+
135
+ query_parameters = {}
136
+ query_parameters['apiKey'] = @api_key
137
+ query_parameters['clientGuid'] = client_guid
138
+ unless isNullOrWhiteSpace(fields)
139
+ query_parameters['fields'] = fields
140
+ end
141
+
142
+ resource_path = 'identity/v2/auth/login/smartlogin/ping'
143
+ get_request(resource_path, query_parameters, nil)
144
+ end
145
+ end
146
+ end
@@ -0,0 +1,193 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Created by LoginRadius Development Team
4
+ # Copyright 2019 LoginRadius Inc. All rights reserved.
5
+ require_relative '../../request_client'
6
+
7
+ module LoginRadius
8
+ # NativeSocialApi module
9
+ class NativeSocialApi
10
+ include RequestClient
11
+
12
+ attr_accessor :site_name, :api_key, :api_secret
13
+
14
+ # Initializes a LoginRadius Account object with an apikey and secret
15
+ # Takes in a hash containing site_name(required), api_key(required), api_secret(required)
16
+ def initialize
17
+ @site_name = ENV['SITE_NAME']
18
+ @api_key = ENV['API_KEY']
19
+ @api_secret = ENV['API_SECRET']
20
+ raise LoginRadius::Error.new, "'site_name' is a required option for Account class initialization." \
21
+ unless @site_name != '' && @site_name != nil
22
+ raise LoginRadius::Error.new, "'api_key' is a required option for Account class initialization." \
23
+ unless @api_key != '' && @api_key != nil
24
+ raise LoginRadius::Error.new, "'api_secret is a required option for Account class initialization." \
25
+ unless @api_secret != '' && @api_secret != nil
26
+ end
27
+
28
+ # The API is used to get LoginRadius access token by sending Facebook's access token. It will be valid for the specific duration of time specified in the response.
29
+ #
30
+ # @param fb__access__token - Facebook Access Token
31
+ #
32
+ # @return Response containing Definition of Complete Token data
33
+ # 20.3
34
+ def get_access_token_by_facebook_access_token(fb__access__token)
35
+ if isNullOrWhiteSpace(fb__access__token)
36
+ raise LoginRadius::Error.new, getValidationMessage('fb__access__token')
37
+ end
38
+
39
+ query_parameters = {}
40
+ query_parameters['fb_Access_Token'] = fb__access__token
41
+ query_parameters['key'] = @api_key
42
+
43
+ resource_path = 'api/v2/access_token/facebook'
44
+ get_request(resource_path, query_parameters, nil)
45
+ end
46
+
47
+ # The API is used to get LoginRadius access token by sending Twitter's access token. It will be valid for the specific duration of time specified in the response.
48
+ #
49
+ # @param tw__access__token - Twitter Access Token
50
+ # @param tw__token__secret - Twitter Token Secret
51
+ #
52
+ # @return Response containing Definition of Complete Token data
53
+ # 20.4
54
+ def get_access_token_by_twitter_access_token(tw__access__token, tw__token__secret)
55
+ if isNullOrWhiteSpace(tw__access__token)
56
+ raise LoginRadius::Error.new, getValidationMessage('tw__access__token')
57
+ end
58
+ if isNullOrWhiteSpace(tw__token__secret)
59
+ raise LoginRadius::Error.new, getValidationMessage('tw__token__secret')
60
+ end
61
+
62
+ query_parameters = {}
63
+ query_parameters['key'] = @api_key
64
+ query_parameters['tw_Access_Token'] = tw__access__token
65
+ query_parameters['tw_Token_Secret'] = tw__token__secret
66
+
67
+ resource_path = 'api/v2/access_token/twitter'
68
+ get_request(resource_path, query_parameters, nil)
69
+ end
70
+
71
+ # The API is used to get LoginRadius access token by sending Google's access token. It will be valid for the specific duration of time specified in the response.
72
+ #
73
+ # @param google__access__token - Google Access Token
74
+ # @param client_id - Google Client ID
75
+ # @param refresh_token - LoginRadius refresh token
76
+ #
77
+ # @return Response containing Definition of Complete Token data
78
+ # 20.5
79
+ def get_access_token_by_google_access_token(google__access__token, client_id = '', refresh_token = '')
80
+ if isNullOrWhiteSpace(google__access__token)
81
+ raise LoginRadius::Error.new, getValidationMessage('google__access__token')
82
+ end
83
+
84
+ query_parameters = {}
85
+ query_parameters['google_Access_Token'] = google__access__token
86
+ query_parameters['key'] = @api_key
87
+ unless isNullOrWhiteSpace(client_id)
88
+ query_parameters['client_id'] = client_id
89
+ end
90
+ unless isNullOrWhiteSpace(refresh_token)
91
+ query_parameters['refresh_token'] = refresh_token
92
+ end
93
+
94
+ resource_path = 'api/v2/access_token/google'
95
+ get_request(resource_path, query_parameters, nil)
96
+ end
97
+
98
+ # This API is used to Get LoginRadius Access Token using google jwt id token for google native mobile login/registration.
99
+ #
100
+ # @param id__token - Google JWT id_token
101
+ #
102
+ # @return Response containing Definition of Complete Token data
103
+ # 20.6
104
+ def get_access_token_by_google_j_w_t_access_token(id__token)
105
+ if isNullOrWhiteSpace(id__token)
106
+ raise LoginRadius::Error.new, getValidationMessage('id__token')
107
+ end
108
+
109
+ query_parameters = {}
110
+ query_parameters['id_Token'] = id__token
111
+ query_parameters['key'] = @api_key
112
+
113
+ resource_path = 'api/v2/access_token/googlejwt'
114
+ get_request(resource_path, query_parameters, nil)
115
+ end
116
+
117
+ # The API is used to get LoginRadius access token by sending Linkedin's access token. It will be valid for the specific duration of time specified in the response.
118
+ #
119
+ # @param ln__access__token - Linkedin Access Token
120
+ #
121
+ # @return Response containing Definition of Complete Token data
122
+ # 20.7
123
+ def get_access_token_by_linkedin_access_token(ln__access__token)
124
+ if isNullOrWhiteSpace(ln__access__token)
125
+ raise LoginRadius::Error.new, getValidationMessage('ln__access__token')
126
+ end
127
+
128
+ query_parameters = {}
129
+ query_parameters['key'] = @api_key
130
+ query_parameters['ln_Access_Token'] = ln__access__token
131
+
132
+ resource_path = 'api/v2/access_token/linkedin'
133
+ get_request(resource_path, query_parameters, nil)
134
+ end
135
+
136
+ # The API is used to get LoginRadius access token by sending Foursquare's access token. It will be valid for the specific duration of time specified in the response.
137
+ #
138
+ # @param fs__access__token - Foursquare Access Token
139
+ #
140
+ # @return Response containing Definition of Complete Token data
141
+ # 20.8
142
+ def get_access_token_by_foursquare_access_token(fs__access__token)
143
+ if isNullOrWhiteSpace(fs__access__token)
144
+ raise LoginRadius::Error.new, getValidationMessage('fs__access__token')
145
+ end
146
+
147
+ query_parameters = {}
148
+ query_parameters['fs_Access_Token'] = fs__access__token
149
+ query_parameters['key'] = @api_key
150
+
151
+ resource_path = 'api/v2/access_token/foursquare'
152
+ get_request(resource_path, query_parameters, nil)
153
+ end
154
+
155
+ # The API is used to get LoginRadius access token by sending Vkontakte's access token. It will be valid for the specific duration of time specified in the response.
156
+ #
157
+ # @param vk_access_token - Vkontakte Access Token
158
+ #
159
+ # @return Response containing Definition of Complete Token data
160
+ # 20.15
161
+ def get_access_token_by_vkontakte_access_token(vk_access_token)
162
+ if isNullOrWhiteSpace(vk_access_token)
163
+ raise LoginRadius::Error.new, getValidationMessage('vk_access_token')
164
+ end
165
+
166
+ query_parameters = {}
167
+ query_parameters['key'] = @api_key
168
+ query_parameters['vk_access_token'] = vk_access_token
169
+
170
+ resource_path = 'api/v2/access_token/vkontakte'
171
+ get_request(resource_path, query_parameters, nil)
172
+ end
173
+
174
+ # The API is used to get LoginRadius access token by sending Google's AuthCode. It will be valid for the specific duration of time specified in the response.
175
+ #
176
+ # @param google_authcode - Google AuthCode
177
+ #
178
+ # @return Response containing Definition of Complete Token data
179
+ # 20.16
180
+ def get_access_token_by_google_auth_code(google_authcode)
181
+ if isNullOrWhiteSpace(google_authcode)
182
+ raise LoginRadius::Error.new, getValidationMessage('google_authcode')
183
+ end
184
+
185
+ query_parameters = {}
186
+ query_parameters['apiKey'] = @api_key
187
+ query_parameters['google_authcode'] = google_authcode
188
+
189
+ resource_path = 'api/v2/access_token/google'
190
+ get_request(resource_path, query_parameters, nil)
191
+ end
192
+ end
193
+ end
@@ -0,0 +1,802 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Created by LoginRadius Development Team
4
+ # Copyright 2019 LoginRadius Inc. All rights reserved.
5
+ require_relative '../../request_client'
6
+
7
+ module LoginRadius
8
+ # SocialApi module
9
+ class SocialApi
10
+ include RequestClient
11
+
12
+ attr_accessor :site_name, :api_key, :api_secret
13
+
14
+ # Initializes a LoginRadius Account object with an apikey and secret
15
+ # Takes in a hash containing site_name(required), api_key(required), api_secret(required)
16
+ def initialize
17
+ @site_name = ENV['SITE_NAME']
18
+ @api_key = ENV['API_KEY']
19
+ @api_secret = ENV['API_SECRET']
20
+ raise LoginRadius::Error.new, "'site_name' is a required option for Account class initialization." \
21
+ unless @site_name != '' && @site_name != nil
22
+ raise LoginRadius::Error.new, "'api_key' is a required option for Account class initialization." \
23
+ unless @api_key != '' && @api_key != nil
24
+ raise LoginRadius::Error.new, "'api_secret is a required option for Account class initialization." \
25
+ unless @api_secret != '' && @api_secret != nil
26
+ end
27
+
28
+ # This API Is used to translate the Request Token returned during authentication into an Access Token that can be used with other API calls.
29
+ #
30
+ # @param token - Token generated from a successful oauth from social platform
31
+ #
32
+ # @return Response containing Definition of Complete Token data
33
+ # 20.1
34
+ def exchange_access_token(token)
35
+ if isNullOrWhiteSpace(token)
36
+ raise LoginRadius::Error.new, getValidationMessage('token')
37
+ end
38
+
39
+ query_parameters = {}
40
+ query_parameters['secret'] = @api_secret
41
+ query_parameters['token'] = token
42
+
43
+ resource_path = 'api/v2/access_token'
44
+ get_request(resource_path, query_parameters, nil)
45
+ end
46
+
47
+ # The Refresh Access Token API is used to refresh the provider access token after authentication. It will be valid for up to 60 days on LoginRadius depending on the provider. In order to use the access token in other APIs, always refresh the token using this API.<br><br><b>Supported Providers :</b> Facebook,Yahoo,Google,Twitter, Linkedin.<br><br> Contact LoginRadius support team to enable this API.
48
+ #
49
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
50
+ # @param expires_in - Allows you to specify a desired expiration time in minutes for the newly issued access token.
51
+ #
52
+ # @return Response containing Definition of Complete Token data
53
+ # 20.2
54
+ def refresh_access_token(access_token, expires_in)
55
+ if isNullOrWhiteSpace(access_token)
56
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
57
+ end
58
+
59
+ query_parameters = {}
60
+ query_parameters['access_token'] = access_token
61
+ query_parameters['secret'] = @api_secret
62
+ unless expires_in == false
63
+ query_parameters['expiresIn'] = expires_in
64
+ end
65
+
66
+ resource_path = 'api/v2/access_token/refresh'
67
+ get_request(resource_path, query_parameters, nil)
68
+ end
69
+
70
+ # This API validates access token, if valid then returns a response with its expiry otherwise error.
71
+ #
72
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
73
+ #
74
+ # @return Response containing Definition of Complete Token data
75
+ # 20.9
76
+ def validate_access_token(access_token)
77
+ if isNullOrWhiteSpace(access_token)
78
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
79
+ end
80
+
81
+ query_parameters = {}
82
+ query_parameters['access_token'] = access_token
83
+ query_parameters['key'] = @api_key
84
+ query_parameters['secret'] = @api_secret
85
+
86
+ resource_path = 'api/v2/access_token/validate'
87
+ get_request(resource_path, query_parameters, nil)
88
+ end
89
+
90
+ # This api invalidates the active access token or expires an access token validity.
91
+ #
92
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
93
+ #
94
+ # @return Response containing Definition for Complete Validation data
95
+ # 20.10
96
+ def in_validate_access_token(access_token)
97
+ if isNullOrWhiteSpace(access_token)
98
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
99
+ end
100
+
101
+ query_parameters = {}
102
+ query_parameters['access_token'] = access_token
103
+ query_parameters['key'] = @api_key
104
+ query_parameters['secret'] = @api_secret
105
+
106
+ resource_path = 'api/v2/access_token/invalidate'
107
+ get_request(resource_path, query_parameters, nil)
108
+ end
109
+
110
+ # This api is use to get all active session by Access Token.
111
+ #
112
+ # @param token - Token generated from a successful oauth from social platform
113
+ #
114
+ # @return Response containing Definition for Complete active sessions
115
+ # 20.11.1
116
+ def get_active_session(token)
117
+ if isNullOrWhiteSpace(token)
118
+ raise LoginRadius::Error.new, getValidationMessage('token')
119
+ end
120
+
121
+ query_parameters = {}
122
+ query_parameters['key'] = @api_key
123
+ query_parameters['secret'] = @api_secret
124
+ query_parameters['token'] = token
125
+
126
+ resource_path = 'api/v2/access_token/activesession'
127
+ get_request(resource_path, query_parameters, nil)
128
+ end
129
+
130
+ # This api is used to get all active sessions by AccountID(UID).
131
+ #
132
+ # @param account_id - UID, the unified identifier for each user account
133
+ #
134
+ # @return Response containing Definition for Complete active sessions
135
+ # 20.11.2
136
+ def get_active_session_by_account_id(account_id)
137
+ if isNullOrWhiteSpace(account_id)
138
+ raise LoginRadius::Error.new, getValidationMessage('account_id')
139
+ end
140
+
141
+ query_parameters = {}
142
+ query_parameters['accountId'] = account_id
143
+ query_parameters['key'] = @api_key
144
+ query_parameters['secret'] = @api_secret
145
+
146
+ resource_path = 'api/v2/access_token/activesession'
147
+ get_request(resource_path, query_parameters, nil)
148
+ end
149
+
150
+ # This api is used to get all active sessions by ProfileId.
151
+ #
152
+ # @param profile_id - Social Provider Id
153
+ #
154
+ # @return Response containing Definition for Complete active sessions
155
+ # 20.11.3
156
+ def get_active_session_by_profile_id(profile_id)
157
+ if isNullOrWhiteSpace(profile_id)
158
+ raise LoginRadius::Error.new, getValidationMessage('profile_id')
159
+ end
160
+
161
+ query_parameters = {}
162
+ query_parameters['key'] = @api_key
163
+ query_parameters['profileId'] = profile_id
164
+ query_parameters['secret'] = @api_secret
165
+
166
+ resource_path = 'api/v2/access_token/activesession'
167
+ get_request(resource_path, query_parameters, nil)
168
+ end
169
+
170
+ # <b>Supported Providers:</b> Facebook, Google, Live, Vkontakte.<br><br> This API returns the photo albums associated with the passed in access tokens Social Profile.
171
+ #
172
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
173
+ #
174
+ # @return Response Containing List of Album Data
175
+ # 22.2.1
176
+ def get_albums(access_token)
177
+ if isNullOrWhiteSpace(access_token)
178
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
179
+ end
180
+
181
+ query_parameters = {}
182
+ query_parameters['access_token'] = access_token
183
+
184
+ resource_path = 'api/v2/album'
185
+ get_request(resource_path, query_parameters, nil)
186
+ end
187
+
188
+ # <b>Supported Providers:</b> Facebook, Google, Live, Vkontakte.<br><br> This API returns the photo albums associated with the passed in access tokens Social Profile.
189
+ #
190
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
191
+ # @param next_cursor - Cursor value if not all contacts can be retrieved once.
192
+ #
193
+ # @return Response Model containing Albums with next cursor
194
+ # 22.2.2
195
+ def get_albums_with_cursor(access_token, next_cursor)
196
+ if isNullOrWhiteSpace(access_token)
197
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
198
+ end
199
+ if isNullOrWhiteSpace(next_cursor)
200
+ raise LoginRadius::Error.new, getValidationMessage('next_cursor')
201
+ end
202
+
203
+ query_parameters = {}
204
+ query_parameters['access_token'] = access_token
205
+ query_parameters['nextCursor'] = next_cursor
206
+
207
+ resource_path = 'api/v2/album'
208
+ get_request(resource_path, query_parameters, nil)
209
+ end
210
+
211
+ # The Audio API is used to get audio files data from the user's social account.<br><br><b>Supported Providers:</b> Live, Vkontakte
212
+ #
213
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
214
+ #
215
+ # @return Response Containing List of Audio Data
216
+ # 24.2.1
217
+ def get_audios(access_token)
218
+ if isNullOrWhiteSpace(access_token)
219
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
220
+ end
221
+
222
+ query_parameters = {}
223
+ query_parameters['access_token'] = access_token
224
+
225
+ resource_path = 'api/v2/audio'
226
+ get_request(resource_path, query_parameters, nil)
227
+ end
228
+
229
+ # The Audio API is used to get audio files data from the user's social account.<br><br><b>Supported Providers:</b> Live, Vkontakte
230
+ #
231
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
232
+ # @param next_cursor - Cursor value if not all contacts can be retrieved once.
233
+ #
234
+ # @return Response Model containing Audio with next cursor
235
+ # 24.2.2
236
+ def get_audios_with_cursor(access_token, next_cursor)
237
+ if isNullOrWhiteSpace(access_token)
238
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
239
+ end
240
+ if isNullOrWhiteSpace(next_cursor)
241
+ raise LoginRadius::Error.new, getValidationMessage('next_cursor')
242
+ end
243
+
244
+ query_parameters = {}
245
+ query_parameters['access_token'] = access_token
246
+ query_parameters['nextCursor'] = next_cursor
247
+
248
+ resource_path = 'api/v2/audio'
249
+ get_request(resource_path, query_parameters, nil)
250
+ end
251
+
252
+ # The Check In API is used to get check Ins data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Vkontakte
253
+ #
254
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
255
+ #
256
+ # @return Response Containing List of CheckIn Data
257
+ # 25.2.1
258
+ def get_check_ins(access_token)
259
+ if isNullOrWhiteSpace(access_token)
260
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
261
+ end
262
+
263
+ query_parameters = {}
264
+ query_parameters['access_token'] = access_token
265
+
266
+ resource_path = 'api/v2/checkin'
267
+ get_request(resource_path, query_parameters, nil)
268
+ end
269
+
270
+ # The Check In API is used to get check Ins data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Vkontakte
271
+ #
272
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
273
+ # @param next_cursor - Cursor value if not all contacts can be retrieved once.
274
+ #
275
+ # @return Response Model containing Checkins with next cursor
276
+ # 25.2.2
277
+ def get_check_ins_with_cursor(access_token, next_cursor)
278
+ if isNullOrWhiteSpace(access_token)
279
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
280
+ end
281
+ if isNullOrWhiteSpace(next_cursor)
282
+ raise LoginRadius::Error.new, getValidationMessage('next_cursor')
283
+ end
284
+
285
+ query_parameters = {}
286
+ query_parameters['access_token'] = access_token
287
+ query_parameters['nextCursor'] = next_cursor
288
+
289
+ resource_path = 'api/v2/checkin'
290
+ get_request(resource_path, query_parameters, nil)
291
+ end
292
+
293
+ # The Contact API is used to get contacts/friends/connections data from the user's social account.This is one of the APIs that makes up the LoginRadius Friend Invite System. The data will normalized into LoginRadius' standard data format. This API requires setting permissions in your LoginRadius Dashboard. <br><br><b>Note:</b> Facebook restricts access to the list of friends that is returned. When using the Contacts API with Facebook you will only receive friends that have accepted some permissions with your app. <br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, LinkedIn, Live, Twitter, Vkontakte, Yahoo
294
+ #
295
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
296
+ # @param next_cursor - Cursor value if not all contacts can be retrieved once.
297
+ #
298
+ # @return Response containing Definition of Contact Data with Cursor
299
+ # 27.1
300
+ def get_contacts(access_token, next_cursor = '')
301
+ if isNullOrWhiteSpace(access_token)
302
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
303
+ end
304
+
305
+ query_parameters = {}
306
+ query_parameters['access_token'] = access_token
307
+ unless isNullOrWhiteSpace(next_cursor)
308
+ query_parameters['nextCursor'] = next_cursor
309
+ end
310
+
311
+ resource_path = 'api/v2/contact'
312
+ get_request(resource_path, query_parameters, nil)
313
+ end
314
+
315
+ # The Event API is used to get the event data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Live
316
+ #
317
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
318
+ #
319
+ # @return Response Containing List of Events Data
320
+ # 28.2.1
321
+ def get_events(access_token)
322
+ if isNullOrWhiteSpace(access_token)
323
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
324
+ end
325
+
326
+ query_parameters = {}
327
+ query_parameters['access_token'] = access_token
328
+
329
+ resource_path = 'api/v2/event'
330
+ get_request(resource_path, query_parameters, nil)
331
+ end
332
+
333
+ # The Event API is used to get the event data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Live
334
+ #
335
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
336
+ # @param next_cursor - Cursor value if not all contacts can be retrieved once.
337
+ #
338
+ # @return Response Model containing Events with next cursor
339
+ # 28.2.2
340
+ def get_events_with_cursor(access_token, next_cursor)
341
+ if isNullOrWhiteSpace(access_token)
342
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
343
+ end
344
+ if isNullOrWhiteSpace(next_cursor)
345
+ raise LoginRadius::Error.new, getValidationMessage('next_cursor')
346
+ end
347
+
348
+ query_parameters = {}
349
+ query_parameters['access_token'] = access_token
350
+ query_parameters['nextCursor'] = next_cursor
351
+
352
+ resource_path = 'api/v2/event'
353
+ get_request(resource_path, query_parameters, nil)
354
+ end
355
+
356
+ # Get the following user list from the user's social account.<br><br><b>Supported Providers:</b> Twitter
357
+ #
358
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
359
+ #
360
+ # @return Response Containing List of Contacts Data
361
+ # 29.2.1
362
+ def get_followings(access_token)
363
+ if isNullOrWhiteSpace(access_token)
364
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
365
+ end
366
+
367
+ query_parameters = {}
368
+ query_parameters['access_token'] = access_token
369
+
370
+ resource_path = 'api/v2/following'
371
+ get_request(resource_path, query_parameters, nil)
372
+ end
373
+
374
+ # Get the following user list from the user's social account.<br><br><b>Supported Providers:</b> Twitter
375
+ #
376
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
377
+ # @param next_cursor - Cursor value if not all contacts can be retrieved once.
378
+ #
379
+ # @return Response containing Definition of Contact Data with Cursor
380
+ # 29.2.2
381
+ def get_followings_with_cursor(access_token, next_cursor)
382
+ if isNullOrWhiteSpace(access_token)
383
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
384
+ end
385
+ if isNullOrWhiteSpace(next_cursor)
386
+ raise LoginRadius::Error.new, getValidationMessage('next_cursor')
387
+ end
388
+
389
+ query_parameters = {}
390
+ query_parameters['access_token'] = access_token
391
+ query_parameters['nextCursor'] = next_cursor
392
+
393
+ resource_path = 'api/v2/following'
394
+ get_request(resource_path, query_parameters, nil)
395
+ end
396
+
397
+ # The Group API is used to get group data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Vkontakte
398
+ #
399
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
400
+ #
401
+ # @return Response Containing List of Groups Data
402
+ # 30.2.1
403
+ def get_groups(access_token)
404
+ if isNullOrWhiteSpace(access_token)
405
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
406
+ end
407
+
408
+ query_parameters = {}
409
+ query_parameters['access_token'] = access_token
410
+
411
+ resource_path = 'api/v2/group'
412
+ get_request(resource_path, query_parameters, nil)
413
+ end
414
+
415
+ # The Group API is used to get group data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Vkontakte
416
+ #
417
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
418
+ # @param next_cursor - Cursor value if not all contacts can be retrieved once.
419
+ #
420
+ # @return Response Model containing Groups with next cursor
421
+ # 30.2.2
422
+ def get_groups_with_cursor(access_token, next_cursor)
423
+ if isNullOrWhiteSpace(access_token)
424
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
425
+ end
426
+ if isNullOrWhiteSpace(next_cursor)
427
+ raise LoginRadius::Error.new, getValidationMessage('next_cursor')
428
+ end
429
+
430
+ query_parameters = {}
431
+ query_parameters['access_token'] = access_token
432
+ query_parameters['nextCursor'] = next_cursor
433
+
434
+ resource_path = 'api/v2/group'
435
+ get_request(resource_path, query_parameters, nil)
436
+ end
437
+
438
+ # The Like API is used to get likes data from the user's social account.<br><br><b>Supported Providers:</b> Facebook
439
+ #
440
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
441
+ #
442
+ # @return Response Containing List of Likes Data
443
+ # 31.2.1
444
+ def get_likes(access_token)
445
+ if isNullOrWhiteSpace(access_token)
446
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
447
+ end
448
+
449
+ query_parameters = {}
450
+ query_parameters['access_token'] = access_token
451
+
452
+ resource_path = 'api/v2/like'
453
+ get_request(resource_path, query_parameters, nil)
454
+ end
455
+
456
+ # The Like API is used to get likes data from the user's social account.<br><br><b>Supported Providers:</b> Facebook
457
+ #
458
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
459
+ # @param next_cursor - Cursor value if not all contacts can be retrieved once.
460
+ #
461
+ # @return Response Model containing Likes with next cursor
462
+ # 31.2.2
463
+ def get_likes_with_cursor(access_token, next_cursor)
464
+ if isNullOrWhiteSpace(access_token)
465
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
466
+ end
467
+ if isNullOrWhiteSpace(next_cursor)
468
+ raise LoginRadius::Error.new, getValidationMessage('next_cursor')
469
+ end
470
+
471
+ query_parameters = {}
472
+ query_parameters['access_token'] = access_token
473
+ query_parameters['nextCursor'] = next_cursor
474
+
475
+ resource_path = 'api/v2/like'
476
+ get_request(resource_path, query_parameters, nil)
477
+ end
478
+
479
+ # The Mention API is used to get mentions data from the user's social account.<br><br><b>Supported Providers:</b> Twitter
480
+ #
481
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
482
+ #
483
+ # @return Response Containing List of Status Data
484
+ # 32.1
485
+ def get_mentions(access_token)
486
+ if isNullOrWhiteSpace(access_token)
487
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
488
+ end
489
+
490
+ query_parameters = {}
491
+ query_parameters['access_token'] = access_token
492
+
493
+ resource_path = 'api/v2/mention'
494
+ get_request(resource_path, query_parameters, nil)
495
+ end
496
+
497
+ # Post Message API is used to post messages to the user's contacts.<br><br><b>Supported Providers:</b> Twitter, LinkedIn <br><br>The Message API is used to post messages to the user?s contacts. This is one of the APIs that makes up the LoginRadius Friend Invite System. After using the Contact API, you can send messages to the retrieved contacts. This API requires setting permissions in your LoginRadius Dashboard.<br><br>GET & POST Message API work the same way except the API method is different
498
+ #
499
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
500
+ # @param message - Body of your message
501
+ # @param subject - Subject of your message
502
+ # @param to - Recipient's social provider's id
503
+ #
504
+ # @return Response containing Definition for Complete Validation data
505
+ # 33.1
506
+ def post_message(access_token, message, subject, to)
507
+ if isNullOrWhiteSpace(access_token)
508
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
509
+ end
510
+ if isNullOrWhiteSpace(message)
511
+ raise LoginRadius::Error.new, getValidationMessage('message')
512
+ end
513
+ if isNullOrWhiteSpace(subject)
514
+ raise LoginRadius::Error.new, getValidationMessage('subject')
515
+ end
516
+ if isNullOrWhiteSpace(to)
517
+ raise LoginRadius::Error.new, getValidationMessage('to')
518
+ end
519
+
520
+ query_parameters = {}
521
+ query_parameters['access_token'] = access_token
522
+ query_parameters['message'] = message
523
+ query_parameters['subject'] = subject
524
+ query_parameters['to'] = to
525
+
526
+ resource_path = 'api/v2/message'
527
+ post_request(resource_path, query_parameters, nil)
528
+ end
529
+
530
+ # The Page API is used to get the page data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, LinkedIn
531
+ #
532
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
533
+ # @param page_name - Name of the page you want to retrieve info from
534
+ #
535
+ # @return Response containing Definition of Complete page data
536
+ # 34.1
537
+ def get_page(access_token, page_name)
538
+ if isNullOrWhiteSpace(access_token)
539
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
540
+ end
541
+ if isNullOrWhiteSpace(page_name)
542
+ raise LoginRadius::Error.new, getValidationMessage('page_name')
543
+ end
544
+
545
+ query_parameters = {}
546
+ query_parameters['access_token'] = access_token
547
+ query_parameters['pageName'] = page_name
548
+
549
+ resource_path = 'api/v2/page'
550
+ get_request(resource_path, query_parameters, nil)
551
+ end
552
+
553
+ # The Photo API is used to get photo data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, Live, Vkontakte
554
+ #
555
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
556
+ # @param album_id - The id of the album you want to retrieve info from
557
+ #
558
+ # @return Response Containing List of Photos Data
559
+ # 35.1
560
+ def get_photos(access_token, album_id)
561
+ if isNullOrWhiteSpace(access_token)
562
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
563
+ end
564
+ if isNullOrWhiteSpace(album_id)
565
+ raise LoginRadius::Error.new, getValidationMessage('album_id')
566
+ end
567
+
568
+ query_parameters = {}
569
+ query_parameters['access_token'] = access_token
570
+ query_parameters['albumId'] = album_id
571
+
572
+ resource_path = 'api/v2/photo'
573
+ get_request(resource_path, query_parameters, nil)
574
+ end
575
+
576
+ # The Post API is used to get post message data from the user's social account.<br><br><b>Supported Providers:</b> Facebook
577
+ #
578
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
579
+ #
580
+ # @return Response Containing List of Posts Data
581
+ # 36.1
582
+ def get_posts(access_token)
583
+ if isNullOrWhiteSpace(access_token)
584
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
585
+ end
586
+
587
+ query_parameters = {}
588
+ query_parameters['access_token'] = access_token
589
+
590
+ resource_path = 'api/v2/post'
591
+ get_request(resource_path, query_parameters, nil)
592
+ end
593
+
594
+ # The Status API is used to update the status on the user's wall.<br><br><b>Supported Providers:</b> Facebook, Twitter, LinkedIn
595
+ #
596
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
597
+ # @param caption - Message displayed below the description(Requires URL, Under 70 Characters).
598
+ # @param description - Description of the displayed URL and Image(Requires URL)
599
+ # @param imageurl - Image to be displayed in the share(Requires URL).
600
+ # @param status - Main body of the Status update.
601
+ # @param title - Title of Linked URL
602
+ # @param url - URL to be included when clicking on the share.
603
+ # @param shorturl - short url
604
+ #
605
+ # @return Response conatining Definition of Validation and Short URL data
606
+ # 37.2
607
+ def status_posting(access_token, caption, description, imageurl, status, title, url, shorturl = '0')
608
+ if isNullOrWhiteSpace(access_token)
609
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
610
+ end
611
+ if isNullOrWhiteSpace(caption)
612
+ raise LoginRadius::Error.new, getValidationMessage('caption')
613
+ end
614
+ if isNullOrWhiteSpace(description)
615
+ raise LoginRadius::Error.new, getValidationMessage('description')
616
+ end
617
+ if isNullOrWhiteSpace(imageurl)
618
+ raise LoginRadius::Error.new, getValidationMessage('imageurl')
619
+ end
620
+ if isNullOrWhiteSpace(status)
621
+ raise LoginRadius::Error.new, getValidationMessage('status')
622
+ end
623
+ if isNullOrWhiteSpace(title)
624
+ raise LoginRadius::Error.new, getValidationMessage('title')
625
+ end
626
+ if isNullOrWhiteSpace(url)
627
+ raise LoginRadius::Error.new, getValidationMessage('url')
628
+ end
629
+
630
+ query_parameters = {}
631
+ query_parameters['access_token'] = access_token
632
+ query_parameters['caption'] = caption
633
+ query_parameters['description'] = description
634
+ query_parameters['imageurl'] = imageurl
635
+ query_parameters['status'] = status
636
+ query_parameters['title'] = title
637
+ query_parameters['url'] = url
638
+ unless isNullOrWhiteSpace(shorturl)
639
+ query_parameters['shorturl'] = shorturl
640
+ end
641
+
642
+ resource_path = 'api/v2/status'
643
+ post_request(resource_path, query_parameters, nil)
644
+ end
645
+
646
+ # The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> The Trackable Status API is used to update the status on the user's wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications.<br><br> POST Input Parameter Format: application/x-www-form-urlencoded
647
+ #
648
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
649
+ # @param status_model - Model Class containing Definition of payload for Status API
650
+ #
651
+ # @return Response containing Definition for Complete status data
652
+ # 37.6
653
+ def trackable_status_posting(access_token, status_model)
654
+ if isNullOrWhiteSpace(access_token)
655
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
656
+ end
657
+ if status_model.blank?
658
+ raise LoginRadius::Error.new, getValidationMessage('status_model')
659
+ end
660
+
661
+ query_parameters = {}
662
+ query_parameters['access_token'] = access_token
663
+
664
+ resource_path = 'api/v2/status/trackable'
665
+ post_request(resource_path, query_parameters, status_model)
666
+ end
667
+
668
+ # The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> The Trackable Status API is used to update the status on the user's wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications.
669
+ #
670
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
671
+ # @param caption - Message displayed below the description(Requires URL, Under 70 Characters).
672
+ # @param description - Description of the displayed URL and Image(Requires URL)
673
+ # @param imageurl - Image to be displayed in the share(Requires URL).
674
+ # @param status - Main body of the Status update.
675
+ # @param title - Title of Linked URL
676
+ # @param url - URL to be included when clicking on the share.
677
+ #
678
+ # @return Response containing Definition for Complete status data
679
+ # 37.7
680
+ def get_trackable_status_stats(access_token, caption, description, imageurl, status, title, url)
681
+ if isNullOrWhiteSpace(access_token)
682
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
683
+ end
684
+ if isNullOrWhiteSpace(caption)
685
+ raise LoginRadius::Error.new, getValidationMessage('caption')
686
+ end
687
+ if isNullOrWhiteSpace(description)
688
+ raise LoginRadius::Error.new, getValidationMessage('description')
689
+ end
690
+ if isNullOrWhiteSpace(imageurl)
691
+ raise LoginRadius::Error.new, getValidationMessage('imageurl')
692
+ end
693
+ if isNullOrWhiteSpace(status)
694
+ raise LoginRadius::Error.new, getValidationMessage('status')
695
+ end
696
+ if isNullOrWhiteSpace(title)
697
+ raise LoginRadius::Error.new, getValidationMessage('title')
698
+ end
699
+ if isNullOrWhiteSpace(url)
700
+ raise LoginRadius::Error.new, getValidationMessage('url')
701
+ end
702
+
703
+ query_parameters = {}
704
+ query_parameters['access_token'] = access_token
705
+ query_parameters['caption'] = caption
706
+ query_parameters['description'] = description
707
+ query_parameters['imageurl'] = imageurl
708
+ query_parameters['status'] = status
709
+ query_parameters['title'] = title
710
+ query_parameters['url'] = url
711
+
712
+ resource_path = 'api/v2/status/trackable/js'
713
+ get_request(resource_path, query_parameters, nil)
714
+ end
715
+
716
+ # The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> This API is used to retrieve a tracked post based on the passed in post ID value. This API requires setting permissions in your LoginRadius Dashboard.<br><br> <b>Note:</b> To utilize this API you need to find the ID for the post you want to track, which might require using Trackable Status Posting API first.
717
+ #
718
+ # @param post_id - Post ID value
719
+ #
720
+ # @return Response containing Definition of Complete Status Update data
721
+ # 37.8
722
+ def trackable_status_fetching(post_id)
723
+ if isNullOrWhiteSpace(post_id)
724
+ raise LoginRadius::Error.new, getValidationMessage('post_id')
725
+ end
726
+
727
+ query_parameters = {}
728
+ query_parameters['postId'] = post_id
729
+ query_parameters['secret'] = @api_secret
730
+
731
+ resource_path = 'api/v2/status/trackable'
732
+ get_request(resource_path, query_parameters, nil)
733
+ end
734
+
735
+ # The User Profile API is used to get social profile data from the user's social account after authentication.<br><br><b>Supported Providers:</b> All
736
+ #
737
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
738
+ # @param fields - The fields parameter filters the API response so that the response only includes a specific set of fields
739
+ #
740
+ # @return Response containing Definition for Complete UserProfile data
741
+ # 38.1
742
+ def get_social_user_profile(access_token, fields = '')
743
+ if isNullOrWhiteSpace(access_token)
744
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
745
+ end
746
+
747
+ query_parameters = {}
748
+ query_parameters['access_token'] = access_token
749
+ unless isNullOrWhiteSpace(fields)
750
+ query_parameters['fields'] = fields
751
+ end
752
+
753
+ resource_path = 'api/v2/userprofile'
754
+ get_request(resource_path, query_parameters, nil)
755
+ end
756
+
757
+ # The User Profile API is used to get the latest updated social profile data from the user's social account after authentication. The social profile will be retrieved via oAuth and OpenID protocols. The data is normalized into LoginRadius' standard data format. This API should be called using the access token retrieved from the refresh access token API.
758
+ #
759
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
760
+ # @param fields - The fields parameter filters the API response so that the response only includes a specific set of fields
761
+ #
762
+ # @return Response containing Definition for Complete UserProfile data
763
+ # 38.2
764
+ def get_refreshed_social_user_profile(access_token, fields = '')
765
+ if isNullOrWhiteSpace(access_token)
766
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
767
+ end
768
+
769
+ query_parameters = {}
770
+ query_parameters['access_token'] = access_token
771
+ unless isNullOrWhiteSpace(fields)
772
+ query_parameters['fields'] = fields
773
+ end
774
+
775
+ resource_path = 'api/v2/userprofile/refresh'
776
+ get_request(resource_path, query_parameters, nil)
777
+ end
778
+
779
+ # The Video API is used to get video files data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Google, Live, Vkontakte
780
+ #
781
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
782
+ # @param next_cursor - Cursor value if not all contacts can be retrieved once.
783
+ #
784
+ # @return Response containing Definition of Video Data with Cursor
785
+ # 39.2
786
+ def get_videos(access_token, next_cursor)
787
+ if isNullOrWhiteSpace(access_token)
788
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
789
+ end
790
+ if isNullOrWhiteSpace(next_cursor)
791
+ raise LoginRadius::Error.new, getValidationMessage('next_cursor')
792
+ end
793
+
794
+ query_parameters = {}
795
+ query_parameters['access_token'] = access_token
796
+ query_parameters['nextCursor'] = next_cursor
797
+
798
+ resource_path = 'api/v2/video'
799
+ get_request(resource_path, query_parameters, nil)
800
+ end
801
+ end
802
+ end