{ "info": { "author": "INET-SDI", "author_email": "inet-sdi@inet.co.th", "bugtrack_url": null, "classifiers": [], "description": "oneplatform-sdk-python\n======================\n\n|OnePlatform Mascot|\n\n|PyPI version|\n\nPython SDK \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a API OnePlatform\n\n\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a OnePlatform API\n-------------------------\n\nSee the official API documentation for more information.\n\u0e15\u0e34\u0e14\u0e15\u0e32\u0e21\u0e04\u0e39\u0e48\u0e21\u0e37\u0e2d\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19 Official API \u0e41\u0e25\u0e30\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2d\u0e37\u0e48\u0e19\u0e46 \u0e44\u0e14\u0e49\u0e17\u0e35\u0e48 https://api.one.th/docs\n\n\u0e01\u0e32\u0e23\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07\n----------\n\n.. code:: bash\n\n $ pip install pyoneplatform\n\n\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\n-----------------\n\nUsage:\n\n.. code:: python\n\n from oneplatform.oneid import OneIDApi\n\n one_id_api = OneIDApi(\n client_id=\"_YOUR_CLIENT_ID_\",\n client_secret=\"_YOUR_CLIENT_SECRET_\",\n ref_code=\"_YOUR_REF_CODE_\"\n )\n\n try:\n r = one_id_api.login(\"_USERNAME_\", \"_PASSWORD_\")\n for k in r:\n key = \"{}\".format(k).ljust(50)\n print(\"{}: {}\".format(key, r[k]))\n except Exception as e:\n print(\"Login failed: \", e)\n exit(1)\n\nPlatform service list:\n----------------------\n\n* One ID:\n * Login with username and password\n * Get profile\n * Verify authorization code\n * Refresh token\n * Generate login link\n\nAPI\n---\n\nOneIDApi\n~~~~~~~~\n\n\\_\\_init\\_\\_(self, client\\_id, client\\_secret, ref\\_code, endpoint='https://one.th', timeout=5)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a OneIDApi\n\n.. code:: python\n\n one_id_api = OneIDApi('_CLIENT_ID_', '_CLIENT_SECRET_', '_REF_CODE_')\n\n\u0e04\u0e38\u0e13\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e04\u0e48\u0e32 ``endpoint`` \u0e41\u0e25\u0e30 ``timeout`` \u0e44\u0e14\u0e49\u0e15\u0e32\u0e21\u0e04\u0e48\u0e32\u0e17\u0e35\u0e48\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\n\nlogin(self, username, password)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nLogin \u0e40\u0e02\u0e49\u0e32\u0e2a\u0e39\u0e48\u0e23\u0e30\u0e1a\u0e1a\u0e42\u0e14\u0e22\u0e43\u0e0a\u0e49 One ID \u0e41\u0e25\u0e30\u0e04\u0e37\u0e19\u0e04\u0e48\u0e32 Token \u0e41\u0e25\u0e30 Information \u0e02\u0e2d\u0e07 user \u0e21\u0e32\u0e43\u0e2b\u0e49\n\n.. code:: python\n\n one_id_api.login('_USERNAME_', '_PASSWORD_')\n\n\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07 Response\n\n.. code:: json\n\n {\n \"token_type\": \"Bearer\",\n \"expires_in\": 86400,\n \"access_token\": \"_ACCESS_TOKEN_\",\n \"refresh_token\": \"_REFRESH_TOKEN_\",\n \"account_id\": \"_ACCOUNT_ID_\",\n \"result\": \"Success\",\n \"username\": \"_USERNAME_\"\n }\n\nrefresh\\_token(self, refresh\\_token)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nRenew Access token \u0e43\u0e2b\u0e21\u0e48\u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e17\u0e35\u0e48 Access token \u0e2b\u0e21\u0e14\u0e2d\u0e32\u0e22\u0e38 \u0e42\u0e14\u0e22\u0e43\u0e0a\u0e49 Refresh token \u0e17\u0e35\u0e48\u0e43\u0e2b\u0e49\u0e21\u0e32\u0e15\u0e31\u0e49\u0e07\u0e41\u0e15\u0e48\u0e15\u0e2d\u0e19 Login\n\n.. code:: python\n\n one_id_api.refresh_token('_REFRESH_TOKEN_')\n\n\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07 Response\n\n.. code:: json\n\n {\n \"token_type\": \"Bearer\",\n \"expires_in\": 86400,\n \"access_token\": \"_ACCESS_TOKEN_\",\n \"refresh_token\": \"_REFRESH_TOKEN_\",\n \"account_id\": \"_ACCOUNT_ID_\",\n \"result\": \"Success\",\n \"username\": \"_USERNAME_\"\n }\n\nverify\\_authorize\\_code(self, authorize\\_code, redirect\\_url=None)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\u0e43\u0e0a\u0e49\u0e01\u0e31\u0e1a\u0e01\u0e32\u0e23 Authentication \u0e41\u0e1a\u0e1a OAuth2 \u0e40\u0e1b\u0e47\u0e19 API \u0e44\u0e27\u0e49\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e2a\u0e48\u0e07 Authorization code \u0e44\u0e1b\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e01\u0e31\u0e1a One ID\n\n.. code:: python\n\n one_id_api.verify_authorize_code('_AUTHORIZATION_CODE_')\n\n\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e2a\u0e48\u0e04\u0e48\u0e32 ``redirect_url`` \u0e44\u0e14\u0e49\u0e15\u0e32\u0e21\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\n\n\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07 Response\n\n.. code:: json\n\n {\n \"token_type\": \"Bearer\",\n \"expires_in\": 86400,\n \"access_token\": \"_ACCESS_TOKEN_\",\n \"refresh_token\": \"_REFRESH_TOKEN_\",\n \"account_id\": \"_ACCOUNT_ID_\",\n \"result\": \"Success\",\n \"username\": \"_USERNAME_\"\n }\n\nget\\_profile(self, access\\_token)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\u0e43\u0e0a\u0e49\u0e43\u0e19\u0e01\u0e32\u0e23\u0e14\u0e36\u0e07\u0e04\u0e48\u0e32 Profile \u0e02\u0e2d\u0e07 user \u0e19\u0e31\u0e49\u0e19\u0e46 \u0e42\u0e14\u0e22\u0e08\u0e30\u0e15\u0e49\u0e2d\u0e07\u0e43\u0e0a\u0e49 Access token \u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e08\u0e32\u0e01\u0e01\u0e32\u0e23 Login \u0e40\u0e2a\u0e21\u0e2d\n\n.. code:: python\n\n one_id_api.get_profile('_ACCESS_TOKEN_')\n\n\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07 Response\n\n.. code:: json\n\n {\n \"id\": \"_ACCOUNT_ID_\",\n \"first_name_th\": null,\n \"last_name_th\": null,\n \"first_name_eng\": null,\n \"last_name_eng\": null,\n \"account_title_th\": null,\n \"account_title_eng\": null,\n \"id_card_type\": \"ID_CARD\",\n \"id_card_num\": \"DUMMY\",\n \"hash_id_card_num\": \"ceec12762e66397b56dad64fd270bb3d694c78fb9cd665354383c0626dbab013\",\n \"account_category\": \"Residential\",\n \"account_sub_category\": \"Thai\",\n \"thai_email\": \"_DEFAULT_THAI_EMAIL_\",\n \"thai_email2\": null,\n \"status_cd\": \"Active\",\n \"birth_date\": null,\n \"status_dt\": \"2019-05-02 16:46:26\",\n \"register_dt\": \"2019-05-02 16:46:26\",\n \"address_id\": null,\n \"created_at\": \"2019-05-02 16:46:26\",\n \"created_by\": \"OPENID_USR\",\n \"updated_at\": \"2019-05-02 16:46:26\",\n \"updated_by\": \"OPENID_USR\",\n \"reason\": null,\n \"tel_no\": null,\n \"name_on_document_th\": null,\n \"name_on_document_eng\": null,\n \"mobile\": [\n {\n \"id\": \"277d6e20-6cbf-11e9-babc-15a0f81e7cb5\",\n \"mobile_no\": \"_MOBILE_NUMBER_\",\n \"created_at\": \"2019-05-02 16:46:26\",\n \"created_by\": \"OPENID_USR\",\n \"updated_at\": \"2019-05-02 16:46:26\",\n \"updated_by\": \"OPENID_USR\",\n \"deleted_at\": null,\n \"pivot\": {\n \"account_id\": \"_ACCOUNT_ID_\",\n \"mobile_id\": \"277d6e20-6cbf-11e9-babc-15a0f81e7cb5\",\n \"created_at\": \"2019-05-02 16:46:26\",\n \"updated_at\": \"2019-05-02 16:46:26\",\n \"status_cd\": \"Active\",\n \"primary_flg\": \"Y\",\n \"mobile_confirm_flg\": null,\n \"mobile_confirm_dt\": null\n }\n }\n ],\n \"email\": [\n {\n \"id\": \"277793e0-6cbf-11e9-a6f2-55c5066f0181\",\n \"email\": \"_DEFAULT_THAI_EMAIL_\",\n \"created_at\": \"2019-05-02 16:46:26\",\n \"created_by\": \"OPENID_USR\",\n \"updated_at\": \"2019-05-02 16:46:26\",\n \"updated_by\": \"OPENID_USR\",\n \"deleted_at\": null,\n \"pivot\": {\n \"account_id\": \"_ACCOUNT_ID_\",\n \"email_id\": \"277793e0-6cbf-11e9-a6f2-55c5066f0181\",\n \"created_at\": \"2019-05-02 16:46:26\",\n \"updated_at\": \"2019-05-02 16:46:26\",\n \"status_cd\": \"Active\",\n \"primary_flg\": \"Y\",\n \"email_confirm_flg\": null,\n \"email_confirm_dt\": null\n }\n }\n ],\n \"address\": [],\n \"account_attribute\": [],\n \"status\": \"data not complete\",\n \"last_update\": \"2019-05-02 16:46:26\"\n }\n\nget\\_login\\_link(self)\n^^^^^^^^^^^^^^^^^^^^^^\n\n\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e14\u0e36\u0e07\u0e04\u0e48\u0e32 Login url \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e43\u0e0a\u0e49\u0e43\u0e19\u0e01\u0e32\u0e23 Login\n\n.. code:: python\n\n one_id_api.get_login_link()\n\n\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07 Link URL \u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e08\u0e32\u0e01\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e01 Function\n\n.. code:: text\n\n https://one.th/api/oauth/getcode?client_id=<_CLIENT_ID_>&response_type=code&scope=\n\n\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16 Return redirect \u0e14\u0e49\u0e27\u0e22 code 302 \u0e44\u0e1b\u0e22\u0e31\u0e07 link \u0e17\u0e35\u0e48\u0e44\u0e14\u0e49 generate \u0e2d\u0e2d\u0e01\u0e21\u0e32 \u0e41\u0e25\u0e30\u0e23\u0e30\u0e1a\u0e1a\u0e02\u0e2d\u0e07 OneID \u0e08\u0e30 redirect \u0e44\u0e1b\u0e22\u0e31\u0e07\u0e2b\u0e19\u0e49\u0e32\u0e43\u0e2b\u0e49\u0e01\u0e23\u0e2d\u0e01 Username/Password\n\n|Login Form|\n\nOneChatApi\n^^^^^^^^^^\n\nhttps://chat-develop.one.th/docs\n\nRequirements\n------------\n\n- Python >= 2.7 or >= 3.4\n\nFor SDK developers\n------------------\n\nFirst install for development.\n\n::\n\n $ pip install -r requirements-dev.txt\n\n\nChangelog\n=========\n\nVersion 0.1.1 (2019-05-07)\n--------------------------\n\n* Fixed One ID version with main lib\n* Clear .idea folder\n* Fix http client for support python v2.7 and v3.7\n* Fixed incorrect readme\n\nVersion 0.1.0 (2019-05-03)\n---------------------------\n\n* First release after prepare library\n* Platform service compatibility:\n * One ID:\n * Login with username and password\n * Get profile\n * Verify authorization code\n * Refresh token\n * Generate login link\n\n.. |PyPI version| image:: https://badge.fury.io/py/pyoneplatform.svg\n :target: https://badge.fury.io/py/pyoneplatform\n.. |Login Form| image:: https://monitor.sdi.one.th/imagik/bj60vbqtpnstbpk7nhs0\n.. |OnePlatform Mascot| image:: https://monitor.sdi.one.th/imagik/bj612eatpnstbpk7nhsg", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/inetspa/oneplatform-sdk-python", "keywords": "", "license": "GNU GPL 3.0", "maintainer": "INET-SDI", "maintainer_email": "inet-sdi@inet.co.th", "name": "pyoneplatform", "package_url": "https://pypi.org/project/pyoneplatform/", "platform": "", "project_url": "https://pypi.org/project/pyoneplatform/", "project_urls": { "Homepage": "https://github.com/inetspa/oneplatform-sdk-python" }, "release_url": "https://pypi.org/project/pyoneplatform/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "OnePlatform API SDK for Python", "version": "0.1.3" }, "last_serial": 5237741, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "0c5c2e12546147906967a332bb8357c8", "sha256": "ad52ce86ca594b64b73c10cce7de06459e9ff322906cb5c0dd8275c0a35c4a2b" }, "downloads": -1, "filename": "pyoneplatform-0.0.1.tar.gz", "has_sig": false, "md5_digest": "0c5c2e12546147906967a332bb8357c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2184, "upload_time": "2019-05-02T10:34:57", "url": "https://files.pythonhosted.org/packages/07/79/0790f3ea87334962d3b60b501493abb5ecc8335c4fd5bd4923bce19fd229/pyoneplatform-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "ebbd8bae1d1869bbe62f71eeef210120", "sha256": "c1669b2d78fd0e52115b897361d1af574a7e65417a1a827281414bee66b3ca61" }, "downloads": -1, "filename": "pyoneplatform-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ebbd8bae1d1869bbe62f71eeef210120", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2164, "upload_time": "2019-05-02T11:00:07", "url": "https://files.pythonhosted.org/packages/66/ae/26ac20b125f1bab12fe3884339a1bc188b317defb36508f98dde526a9dc1/pyoneplatform-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "178fddb5f1c4bcd04c3503d9753cdca9", "sha256": "0981ca2f3905e3a4f662fd2c2ac8a0e4179091cf84146ebb040a1868bc51676b" }, "downloads": -1, "filename": "pyoneplatform-0.0.3.tar.gz", "has_sig": false, "md5_digest": "178fddb5f1c4bcd04c3503d9753cdca9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2166, "upload_time": "2019-05-02T11:02:54", "url": "https://files.pythonhosted.org/packages/48/4f/45a566d7865a8d978017285a9ef413abca95391ec2bfa96e46886e398f1a/pyoneplatform-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "3157e46f9cad943f1314ed5c0ca8de3a", "sha256": "6c35a239378c6c39e104c45d488abd6883fc3103c492213b2efdcb6ef1634cde" }, "downloads": -1, "filename": "pyoneplatform-0.0.4.tar.gz", "has_sig": false, "md5_digest": "3157e46f9cad943f1314ed5c0ca8de3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2131, "upload_time": "2019-05-02T11:11:35", "url": "https://files.pythonhosted.org/packages/cc/d6/e1c49ba7f2ebdc531b09acf012373d9d9ffdb411447b993288e4b799e81d/pyoneplatform-0.0.4.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "491085d1d9319387f5cf1f537400eb62", "sha256": "de005e42fe9d77debe75a62fbb2bf4297ecc3143ed3757341f0f6ff9c6a48acd" }, "downloads": -1, "filename": "pyoneplatform-0.1.0.tar.gz", "has_sig": false, "md5_digest": "491085d1d9319387f5cf1f537400eb62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4354, "upload_time": "2019-05-03T11:17:50", "url": "https://files.pythonhosted.org/packages/06/ad/072a9f2b1a8d7476b79b9ef7adc763070d55ff445f0c7ada39dc6afd4ec4/pyoneplatform-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "9cf600cb8c7cea89af08e54c9914a192", "sha256": "1c92eccdce3ba754fd467e0cd76ebf7574992f45de96d74567036a385c13cbd7" }, "downloads": -1, "filename": "pyoneplatform-0.1.1.tar.gz", "has_sig": false, "md5_digest": "9cf600cb8c7cea89af08e54c9914a192", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4352, "upload_time": "2019-05-07T10:43:25", "url": "https://files.pythonhosted.org/packages/1f/c1/b7b2dd5c2162b96de65690b63ad132c81117b042d3399170cd5fc45c351b/pyoneplatform-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "39fdc069e024c1c734e363d974f41396", "sha256": "3819fd8fd833ba612dcb099d21fae8c1294ca7a713fd864424c54e978f2a20de" }, "downloads": -1, "filename": "pyoneplatform-0.1.2.tar.gz", "has_sig": false, "md5_digest": "39fdc069e024c1c734e363d974f41396", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4347, "upload_time": "2019-05-07T11:08:26", "url": "https://files.pythonhosted.org/packages/fe/c3/b850765b244b45081943f8e147f48e70a688e6b355a282600380f1171b18/pyoneplatform-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "2b71d989218239f6069f75cbf89b1cbe", "sha256": "cf8ed77cc3a84be0b7c3141f68ee35e35da8a5ffdeb034acde181535c54f51be" }, "downloads": -1, "filename": "pyoneplatform-0.1.3.tar.gz", "has_sig": false, "md5_digest": "2b71d989218239f6069f75cbf89b1cbe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5408, "upload_time": "2019-05-07T11:15:55", "url": "https://files.pythonhosted.org/packages/38/e0/207b3c4ff0d4ee936fb17fdc3d112d1a07006f44158298c0b100f43a2be0/pyoneplatform-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2b71d989218239f6069f75cbf89b1cbe", "sha256": "cf8ed77cc3a84be0b7c3141f68ee35e35da8a5ffdeb034acde181535c54f51be" }, "downloads": -1, "filename": "pyoneplatform-0.1.3.tar.gz", "has_sig": false, "md5_digest": "2b71d989218239f6069f75cbf89b1cbe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5408, "upload_time": "2019-05-07T11:15:55", "url": "https://files.pythonhosted.org/packages/38/e0/207b3c4ff0d4ee936fb17fdc3d112d1a07006f44158298c0b100f43a2be0/pyoneplatform-0.1.3.tar.gz" } ] }