Closed ritawu91 closed 4 years ago
To support this feature, there are two APIs introduced. One is to create a backend user with a token attached. The user can not log into our system. A user will interact with our API service by the token. Another API is to reset token when the existing token is not secured.
This API will create a user and return with an API token. A user can use this token to access backend API.
POST /api/v1/users/
Key | Value |
---|---|
username | string |
curl -X POST 'https://127.0.0.1:9111/api/v1/users/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token my_token' \
-d '{"username": "bitmark_account"}'
{"username":"bitmark_account","auth_token":"216d3d849ad9902626a81f769ad9564bcb028a31"}
Reset and generate a new token
POST /api/v1/users/<user_id>/reset_token/
curl -X POST 'https://127.0.0.1:9111/api/v1/users/bitmark_account/reset_token/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token my_token'
{"auth_token":"216d3d849ad9902626a81f769ad9564bcb028a31"}
Hi @lemonlatte , Here is the folder that contains all APIs iOS is calling: https://github.com/bitmark-inc/spring-ios/tree/master/Spring/Services
In specific folder, the file <*>API.swift will define:
Hope it can help. please ping me if anything you need my help :)
As a more advanced user, I’d like API access to personal data so I can read/write this data from my own programs.
Acceptance criteria
Design: turn on API> see a list of instructions
Estimation: 2