Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- step 1:
- run service with 1 parameter AUTHORIZATION_CODE
- step 2:
- POST login.teithe.gr/token
- headers:
- Content-Type: application/x-www-form-urlencoded
- body:
- client_id: MY_CLIENT_ID
- client_secret: MY_CLIENT_SECRET
- grant_type:authorization_code
- code: MY_AUTHORIZATION_CODE
- request success
- - store REFRESH_TOKEN
- - store ACCESS_TOKEN
- request failed
- possible email for notification and kill service
- step 3:
- create methods
- - refresh token
- POST login.teithe.gr/token
- headers:
- Content-Type: application/x-www-form-urlencoded
- body:
- client_id: MY_CLIENT_ID
- client_secret: MY_CLIENT_SECRET
- grant_type:refresh_token
- code: REFRESH_TOKEN
- request success
- - store REFRESH_TOKEN
- - store ACCESS_TOKEN
- request failed
- possible email for notification and kill service
- - load announcments
- GET api.it.teithe.gr/announcements
- headers:
- x-access-token: ACCESS_TOKEN
- Content-Type:application/json
- request success
- - if previews list size < new list
- find new announcments
- send notification
- override list with new list
- request failed
- if code 401
- possible email for notification and kill service
- else
- ignore
- - send notification(id, about, category, name, title)
- post firebase service
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement