{"id":17680797,"url":"https://github.com/bararchy/safe-t-rest","last_synced_at":"2025-03-30T19:13:15.061Z","repository":{"id":27933159,"uuid":"31425573","full_name":"bararchy/safe-t-rest","owner":"bararchy","description":"A ruby gem for Safe-T Box Rest integration","archived":false,"fork":false,"pushed_at":"2015-11-13T09:08:42.000Z","size":228,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T21:36:48.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bararchy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-27T15:27:38.000Z","updated_at":"2015-03-13T17:07:08.000Z","dependencies_parsed_at":"2022-08-20T06:40:30.523Z","dependency_job_id":null,"html_url":"https://github.com/bararchy/safe-t-rest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bararchy%2Fsafe-t-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bararchy%2Fsafe-t-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bararchy%2Fsafe-t-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bararchy%2Fsafe-t-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bararchy","download_url":"https://codeload.github.com/bararchy/safe-t-rest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246365645,"owners_count":20765546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-24T09:08:51.500Z","updated_at":"2025-03-30T19:13:15.035Z","avatar_url":"https://github.com/bararchy.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# safe-t-rest\nA ruby gem for Safe-T Box REST API\n\nBasic usage:\n================\n\n* Install the gem\n```\ngem install safe-t-rest\n```\n\n* Require the gem\n```ruby\nrequire 'safe-t-rest'\n```\n\n* Initialize a new instance (can be empty or set via parameters)\nempty:\n```ruby\nclient = SafeTRest.new\n```\nset using hash:\n```ruby\nclient = SafeTRest.new(url: 'https://Safe-T/ui_api/login.aspx', user_name: 'test', password: '123', extension_id: '1', role_id: '0')\n```\n\n* Configure the client (if you initialized empty)\n```ruby\nclient.url = 'https://Safe-T_Box_Site.com/ui_api/login.aspx'\nclient.username = 'test'\nclient.password = '12345'\nclient.extension_id = '435-34534-24-234-6'\nclient.role_id = '00006'\n```\n\n* Send requests\n```ruby\nputs client.get_apps_process_state('my_packge_GUID.123123')\n\nputs client.get_package_file_list('my_packge_GUID.123123')\n```\n\n* Safe Share\n```ruby\nargs = {\n\t:files =\u003e 'file.txt', # name of file to share\n\t:recipients =\u003e 'alexander.dan@safe-t.com', # Email address of the one you want to share with\n\t:sender_name =\u003e 'Bar Hofesh', \n\t:sender_address =\u003e 'bar.hofesh@safe-t.com',\n\t:subject =\u003e 'Testing Ruby API', # Email Subject\n\t:message =\u003e 'This is a Test message, just checking the Ruby API using REST', # Email body message\n\t:message_encryption_level =\u003e '0', # 0 = high, 1 = normal, 2 = low\n\t:delivery_method =\u003e '0',\n\t:mobile_recipient =\u003e '',\n\t:return_receipt =\u003e true, # get back a notification when the file was downloaded\n\t:safe_reply =\u003e true, # send an safe reply invitation\n\t:max_downloads =\u003e '3', # maximum number of allowed downloads\n\t:package_expiry =\u003e '1440', # in minutes\n\t:folder_path =\u003e '', # empty means root folder\n\t:root_folder_id =\u003e '417' # My Storage ID\n}\n\nclient.safe_share_file(args)\n```\n\n* File Upload\n```ruby\nargs = {\n\t:file_base64 =\u003e 'V29ya2luZyA6KQo=', # the file as a base64 string Base64.encode64(File.read(file))\n\t:file_name =\u003e 'file.txt', # the name of the file\n\t:folder_path =\u003e '', # empty means root folder\n\t:root_folder_id =\u003e 417 # My Storage ID\n}\n\nclient.file_upload(args)\n```\n\n* File Download\n```ruby\nargs = {\n\t:file_name =\u003e 'file.txt', # The name of the file to download\n\t:folder_path =\u003e '', # The path of the file\n\t:root_folder_id =\u003e 417 # My Storage ID\n}\n\nfile = client.file_download(args) # Get back the file as a base64 string\nfile = Base64.decode64(file) # decode the string\nFile.write('file.txt', file) # write decoded file\n```\n\n# RubyDoc\nhttp://www.rubydoc.info/github/bararchy/safe-t-rest/SafeTRest\n\n* Added example client under /bin","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbararchy%2Fsafe-t-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbararchy%2Fsafe-t-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbararchy%2Fsafe-t-rest/lists"}