{"id":22354272,"url":"https://github.com/jonmagic/shoeboxed","last_synced_at":"2025-03-26T12:40:37.951Z","repository":{"id":66309505,"uuid":"10232070","full_name":"jonmagic/shoeboxed","owner":"jonmagic","description":"Shoeboxed is a simple ruby client for the http://shoeboxed.com API, handy for storing and processing documents like receipts and business cards.","archived":false,"fork":false,"pushed_at":"2013-09-03T15:16:57.000Z","size":344,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T04:58:55.087Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonmagic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-22T23:36:28.000Z","updated_at":"2021-06-29T21:35:44.000Z","dependencies_parsed_at":"2023-02-20T02:15:32.195Z","dependency_job_id":null,"html_url":"https://github.com/jonmagic/shoeboxed","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonmagic%2Fshoeboxed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonmagic%2Fshoeboxed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonmagic%2Fshoeboxed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonmagic%2Fshoeboxed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonmagic","download_url":"https://codeload.github.com/jonmagic/shoeboxed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245658958,"owners_count":20651517,"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-12-04T13:12:09.468Z","updated_at":"2025-03-26T12:40:37.929Z","avatar_url":"https://github.com/jonmagic.png","language":"Ruby","readme":"**I am abandoning this project and freeing up the name in rubygems.**\n\n# Shoeboxed\n\nA simple ruby client for the [Shoeboxed](http://shoeboxed.com) [API](http://developer.shoeboxed.com).\n\n## Installation\n\n```bash\n$ gem install shoeboxed\n```\n\nOr include it in your Gemfile:\n\n```ruby\ngem \"shoeboxed\"\n```\n\nFor the bleeding edge reference this repository:\n\n```ruby\ngem \"shoeboxed\", :git =\u003e \"https://github.com/jonmagic/shoeboxed\"\n```\n\n## Usage\n\nYou will need to [signup](https://app.shoeboxed.com/landing/registration3.htm) for a Shoeboxed account and then [request a token](https://app.shoeboxed.com/member/account-api-keys.htm) at which point you will be given an ```api_user_token```.\n\n### Authentication\n\nAfter signing up for an account and requesting a token you will need to use the app name you specified while requesting the token to create an authentication url.\n\nIn addition you will need to add an endpoint to your application that Shoeboxed can hit (similar to the Oauth process) in order to retrieve your ```sbx_user_token```.\n\n#### Creating an sbx_user_token\n\nArmed with the app name and callback url you can generate an authentication url:\n\n```ruby\n\u003e Shoeboxed.authentication_url \\\n    :app_name =\u003e \"Woot!\",\n    :callback_url =\u003e \"http://foo.bar/shoeboxed/callback\"\n=\u003e \"https://api.shoeboxed.com/v1/ws/api.htm?SignIn=1\u0026appname=Hoyt+Accounting\u0026appurl=http%3A%2F%2Ffoo.bar%2Fshoeboxed%2Fcallback\u0026appparams=\"\n```\n\n#### Shoeboxed Client\n\nOnce you have your ```api_user_token``` and ```sbx_user_token``` life is easy. Create a new instance of the Shoeboxed client passing it both tokens in an options hash.\n\n```ruby\n\u003e shoeboxed = Shoeboxed.new(:api_user_token =\u003e \"foo\", :sbx_user_token =\u003e \"bar\")\n=\u003e #\u003cShoeboxed...\u003e\n```\n\n### Upload\n\nYou can upload documents and images to Shoeboxed for storage and processing. Receipts and business cards will be processed and their details stored for easy access via the API.\n\nIn this example the document is a receipt image. The guid, or unique id, is used to reference the uploaded document. In this example I use ```SimpleUUID``` to generate the guid but please note that ```SimpleUUID``` is not included when you install the Shoeboxed gem.\n\n```ruby\n\u003e document = File.open(\"receipt.jpg\")\n=\u003e #\u003cFile...\u003e\n\u003e guid = SimpleUUID::UUID.new.to_guid\n=\u003e \"033c9fa8-c335-11e2-9172-dc397603307a\"\n\u003e shoeboxed.upload(document, {:type =\u003e :receipt, :guid =\u003e guid})\n=\u003e true\n```\n\nPlease note that the options hash is optional. You can upload the document without setting type or guid.\n\n```ruby\n\u003e document = File.open(\"receipt.jpg\")\n=\u003e #\u003cFile...\u003e\n\u003e shoeboxed.upload(document)\n=\u003e true\n```\n### Document Status\n\nGet document status by guid. If you passed a unique id (guid) to the upload method when uploading the document you can later look it up by that guid to see whether it has finished processing, what type of document it is, and get the Shoeboxed document id (needed for making single API request to get the document details).\n\n```ruby\n\u003e status = shoeboxed.status(\"033c9fa8-c335-11e2-9172-dc397603307a\")\n=\u003e #\u003cShoeboxed::Document::Status...\u003e\n\u003e status.done?\n=\u003e true\n```\n\n### Receipts\n\nYou can find a receipt by the unique id (guid) passed in during upload or by it's Shoeboxed id.\n\n#### find_by_guid\n\nThis method of finding a receipt requires two requests, the first to get the status and Shoeboxed id of the receipt and the second to retrieve the receipt by it's Shoeboxed id.\n\nIf the receipt has not finished processing ```find_by_guid``` will return ```nil```:\n\n```ruby\n\u003e shoeboxed.find_by_guid(\"033c9fa8-c335-11e2-9172-dc397603307a\")\n=\u003e nil\n```\n\nOnce it has finished processing it will return a ```Shoeboxed::Receipt``` instance:\n\n```ruby\n\u003e shoeboxed.receipts.find_by_guid(\"033c9fa8-c335-11e2-9172-dc397603307a\")\n=\u003e #\u003cShoeboxed::Receipt...\u003e\n```\n\n#### find_by_type_and_id\n\nFinding the receipt by it's type and Shoeboxed id only requires one request.\n\nIf the receipt is found it will return a ```Shoeboxed::Receipt``` instance:\n\n```ruby\n\u003e shoeboxed.receipts.find_by_type_and_id(\"Receipt\", \"abcd1234\")\n=\u003e #\u003cShoeboxed::Receipt...\u003e\n```\n\nIf the receipt is not found an error is raised:\n\n```ruby\n\u003e shoeboxed.receipts.find_by_type_and_id(\"Receipt\", \"4321dcba\")\nShoeboxed::Error: Error code 5: An internal error has occurred.\n```\n\n## License\n\nSee [LICENSE](LICENSE) for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonmagic%2Fshoeboxed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonmagic%2Fshoeboxed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonmagic%2Fshoeboxed/lists"}