- Download Postman
- Set up acquiring an OKTA Auth token following these instructions. (Add 'guardian.save-for-later.update.self guardian.save-for-later.read.self' to the Scope field in Step 7)
- Select a POST request to https://mobile-save-for-later.mobile-aws.code.dev-guardianapis.com/syncedPrefs/me/savedArticles
- Under the
Authorization
tab, on the type dropdown selectOauth 2
and undertoken
select the token that you saved in the oauth flow - Under the
Headers
tab addContent-Type: application/json
andx-gu-is-oauth: true
- Under the body tab add data in the format:
{
"version": "1526053913596",
"articles": [{
"id": "world/2018/mar/08/donald-trump-north-korea-kim-jong-un-meeting-may-letter-invite-talks-nuclear-weapons",
"shortUrl": "/p/88btx",
"date": "2018-03-09T14:08:02Z",
"read": false
}]
}
- Select a GET request to https://mobile-save-for-later.mobile-aws.code.dev-guardianapis.com/syncedPrefs/me
- Under the
Authorization
tab, on the type dropdown selectOauth 2
and undertoken
select the token that you saved in the oauth flow - Under the
Headers
tab addx-gu-is-oauth: true
- Mobile credentials from Janus
- Make sure you have java 21 installed (SDK man is a good package manager)
- Follow the authentication flow as outlined at the top
- Go to the drop down menu between the build and play button and select
Edit Configurations
- Add the following environment variables:
App=mobile-save-for-later;IdentityApiHost=https://id.code.dev-guardianapis.com;IdentityOktaAudience=https://profile.code.dev-theguardian.com/;IdentityOktaIssuerUrl=https://profile.code.dev-theguardian.com/oauth2/aus3v9gla95Toj0EE0x7;Stage=CODE;SavedArticleLimit=100
- Press the green play button
- Follow the same steps as above for testing endpoints in the rest client by changing the urls to:
GET:
http://localhost:8888/syncedPrefs/me
POST:http://localhost:8888/syncedPrefs/me/savedArticles