Skip to content

Commit 5ec6bd7

Browse files
authored
Update main.rb
1 parent 8b60871 commit 5ec6bd7

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Ruby/appTokenRuby/main.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
require_relative 'model/jsonable'
88
require 'securerandom'
99

10-
# The description of the authorization method is available here: https://developers.sumsub.com/api-reference/#app-tokens
10+
# The description of the authorization method is available here: https://docs.sumsub.com/reference/authentication
1111
APP_TOKEN = 'YOUR_SUMSUB_APP_TOKEN'.freeze # Example: sbx:uY0CgwELmgUAEyl4hNWxLngb.0WSeQeiYny4WEqmAALEAiK2qTC96fBad
1212
SECRET_KEY = 'YOUR_SUMSUB_SECRET_KEY'.freeze # Example: Hej2ch71kG2kTd1iIUDZFNsO5C1lh5Gq
1313
# Please don't forget to change token and secret key values to production ones when switching to production
@@ -16,7 +16,7 @@ def request_env_url(resource)
1616
"https://api.sumsub.com/resources/#{resource}"
1717
end
1818

19-
# https://developers.sumsub.com/api-reference/#creating-an-applicant
19+
# https://docs.sumsub.com/reference/create-applicant
2020

2121
def create_applicant(external_used_id, lang, level_name)
2222
resources = "applicants?levelName=#{level_name}"
@@ -31,7 +31,7 @@ def create_applicant(external_used_id, lang, level_name)
3131
)
3232
end
3333

34-
# https://developers.sumsub.com/api-reference/#adding-an-id-document
34+
# https://docs.sumsub.com/reference/add-id-documents
3535

3636
def upload_photo(applicant_id)
3737
resources = "applicants/#{applicant_id}/info/idDoc"
@@ -52,22 +52,22 @@ def upload_photo(applicant_id)
5252
signed_header(resources, payload, 'POST', "multipart/form-data; boundary=#{bounds}"))
5353
end
5454

55-
# https://developers.sumsub.com/api-reference/#getting-applicant-status-api
55+
# https://docs.sumsub.com/reference/get-applicant-verification-steps-status
5656

5757
def get_applicant_status(applicant_id)
5858
resources = "applicants/#{applicant_id}/requiredIdDocsStatus"
5959
RestClient.get request_env_url(resources), signed_header(resources, nil, 'GET')
6060
end
6161

62-
# https://developers.sumsub.com/api-reference/#getting-applicant-data
62+
# https://docs.sumsub.com/reference/get-applicant-data
6363

6464
def get_applicant_data(applicant_id)
6565
resources = "applicants/#{applicant_id}/one"
6666

6767
response = RestClient.get request_env_url(resources), signed_header(resources, nil, 'GET')
6868
end
6969

70-
# https://developers.sumsub.com/api-reference/#access-tokens-for-sdks
70+
# https://docs.sumsub.com/reference/generate-access-token-query
7171

7272
def generate_access_token(external_user_id, level_name = 'basic-kyc-level', ttl = 600)
7373
raise 'VIOLATION: Null id' if external_user_id.empty?
@@ -79,7 +79,7 @@ def generate_access_token(external_user_id, level_name = 'basic-kyc-level', ttl
7979
JSON.parse(response.body)
8080
end
8181

82-
# https://developers.sumsub.com/api-reference/#app-tokens headers example
82+
# https://docs.sumsub.com/reference/authentication headers example
8383

8484
def signed_header(resource, body = nil, method = 'POST', content_type = 'application/json')
8585
epoch_time = Time.now.to_i
@@ -93,7 +93,6 @@ def signed_header(resource, body = nil, method = 'POST', content_type = 'applica
9393
}
9494
end
9595

96-
# https://developers.sumsub.com/api-reference/#app-tokens
9796

9897
def signed_message(time, resource, body, method = 'POST')
9998
key = SECRET_KEY

0 commit comments

Comments
 (0)