FlashLex API 1.4
What is the FlashLex API?
The FlashLex API is a cloud gateway for the internet of things. It gives your internet connected backend the ability to either send messages to one of your things or get stored messages your things have sent securely.
Its core elements include:
-
Subscriptions - get the info on your subscription and the policy
-
Things - provision things, send messages or deprovision them.
-
Auth - Get JWT access tokens for making API calls.
-
Users - Get you user info and settings.
Authentication
The FlashLex authentication model is based on JWT. JSON Web Tokens are an open,industry standard RFC 7519 method for representing claims securely between two parties. To get and use JWT requires that you authenticate to get a token, and then use that token for subsequent calls.
curl -X GET \
https://apis.flashlex.com/token \
-H 'Authorization: Basic c3VwZXI6c2VjcmV0' \
-H 'Client-Id: clays-postman'
{
"accessToken": "eyJraWQiOiJQTytrSGI5RXB2QjVRSFlka2duWWtRUmtjazhQSVhkakNaUGtFMnJGUFdRPSIsImFsZyI6IlJTMjU2In0.ewogICJzdWIiOiAiYWNkMTNiMTEtNmQ5MS00ZThlLTkxNTYtNjBlNDUxYTNjOTc1IiwKICAiZGV2aWNlX2tleSI6ICJ1cy1lYXN0LTFfYWZhZDA5OWEtNzE0ZC00NDQ2LWExNTktMDEwM2FjMTZjMTVhIiwKICAidG9rZW5fdXNlIjogImFjY2VzcyIsCiAgInNjb3BlIjogImF3cy5jb2duaXRvLnNpZ25pbi51c2VyLmFkbWluIiwKICAiYXV0aF90aW1lIjogMTU2MjA0MzY4MSwKICAiaXNzIjogImh0dHBzOi8vY29nbml0by1pZHAudXMtZWFzdC0xLmFtYXpvbmF3cy5jb20vdXMtZWFzdC0xXzFBcGpyaGtwUCIsCiAgImV4cCI6IDE1NjIwNDcyODEsCiAgImlhdCI6IDE1NjIwNDM2ODEsCiAgImp0aSI6ICIwNzRiOTIyOC0zYmFkLTQ2MDEtODBiYS1lNDJkZWI4MWJkYmMiLAogICJjbGllbnRfaWQiOiAiYXR1ZGNtMjF1a2oxMzdiOW1rbmNtZTF1biIsCiAgInVzZXJuYW1lIjogInRlc3RAZmxhc2hsZXguY29tIgp9.eJu6NrRIu_WoZBrkKi735p1NTyFtpPewsfxmL7O4-rD90mco9bSYOHi2PJtacCTqTQM_YHBcDMydGFvZqHt85xpsJt8C4SgZn3iRyfaxY5HLUJWnvqXBh_bQeuPVyVbcl8riiG5vPo2VmGEIMIXbhBrfMO0WhuNIfRFbu-6eFe0l5LtQG8WBKeh-3FTllmR9q07K2AF8S7nSA9KcAlBHOyKR8SZp-8OPg9WB7rf_fY8oiJryT6L8kfdhViLz4xjK4mW-RLR9SxZxVQ7CH5qKE6c-l9NKb2Z035-5qqsQ-hzc0yinojW9uTV5uk5boEax3LnV9PzLxsYSa5sFKV4eqg"
}
Making calls with a JWT "Bearer"
Once you have an auth token it can be used to make API calls to FlashLex with your backend.
curl -X POST \
https://u100den7gk.execute-api.us-east-1.amazonaws.com/dev/v1/things/48338542-9866-4046-9ecc-ad74e1807cc5/publish \
-H 'Authorization: Bearer eyJraWQiOiJQTytrSGI5RXB2QjVRSFlka2duWWtRUmtjazhQSVhkakNaUGtFMnJGUFdRPSIsImFsZyI6IlJTMjU2In0.ewogICJzdWIiOiAiYWNkMTNiMTEtNmQ5MS00ZThlLTkxNTYtNjBlNDUxYTNjOTc1IiwKICAiZGV2aWNlX2tleSI6ICJ1cy1lYXN0LTFfYWZhZDA5OWEtNzE0ZC00NDQ2LWExNTktMDEwM2FjMTZjMTVhIiwKICAidG9rZW5fdXNlIjogImFjY2VzcyIsCiAgInNjb3BlIjogImF3cy5jb2duaXRvLnNpZ25pbi51c2VyLmFkbWluIiwKICAiYXV0aF90aW1lIjogMTU2MjA0MzY4MSwKICAiaXNzIjogImh0dHBzOi8vY29nbml0by1pZHAudXMtZWFzdC0xLmFtYXpvbmF3cy5jb20vdXMtZWFzdC0xXzFBcGpyaGtwUCIsCiAgImV4cCI6IDE1NjIwNDcyODEsCiAgImlhdCI6IDE1NjIwNDM2ODEsCiAgImp0aSI6ICIwNzRiOTIyOC0zYmFkLTQ2MDEtODBiYS1lNDJkZWI4MWJkYmMiLAogICJjbGllbnRfaWQiOiAiYXR1ZGNtMjF1a2oxMzdiOW1rbmNtZTF1biIsCiAgInVzZXJuYW1lIjogInRlc3RAZmxhc2hsZXguY29tIgp9.eJu6NrRIu_WoZBrkKi735p1NTyFtpPewsfxmL7O4-rD90mco9bSYOHi2PJtacCTqTQM_YHBcDMydGFvZqHt85xpsJt8C4SgZn3iRyfaxY5HLUJWnvqXBh_bQeuPVyVbcl8riiG5vPo2VmGEIMIXbhBrfMO0WhuNIfRFbu-6eFe0l5LtQG8WBKeh-3FTllmR9q07K2AF8S7nSA9KcAlBHOyKR8SZp-8OPg9WB7rf_fY8oiJryT6L8kfdhViLz4xjK4mW-RLR9SxZxVQ7CH5qKE6c-l9NKb2Z035-5qqsQ-hzc0yinojW9uTV5uk5boEax3LnV9PzLxsYSa5sFKV4eqg' \
-H 'Content-Type: application/json' \
-d '{
"body": "Clouds & Rain|82|60|F|24 hours",
"type": "weather",
"behavior": "forecast",
"color": "#cc00ff",
"elapsed": 20
}'