-
-
Notifications
You must be signed in to change notification settings - Fork 8
Get MPG data for opening a bug
Alix Lourme edited this page Aug 5, 2021
·
7 revisions
Some bugs troubleshooting would require MPG data ; the content of HTTP requests received (GET
requests) or sent (PUT/POST
requests) from/to MPG API.
These below Linux command lines (shell: bash
) allowing you to login on MPG API and request simply some endpoints (curl
& jq
are required).
# MPG credentials
export [email protected]
export PASSWORD=yourMpgPassword
# Sign in on MPG on get authentication token
TOKEN=$(curl --silent --request POST --header "Content-Type: application/json" --data '{"login":"'"$LOGIN"'","password":"'"$PASSWORD"'","language":"fr-FR"}' https://api.mpg.football/user/sign-in | jq --raw-output '.token')
# Creating headers file for following requests
echo -e "Content-Type: application/json\nAuthorization: $TOKEN" > /tmp/mpg.headers
# Get some endpoints and display them human readable
curl --silent --request GET --header @/tmp/mpg.headers https://api.mpg.football/dashboard/leagues | jq .
curl --silent --request GET --header @/tmp/mpg.headers https://api.mpg.football/division/[divisionId from '/dashboard/leagues' starting with 'mpg_division_']/coach | jq .
For PUT/POST
content analyse and/or more complex use case (http headers analyse, ...), you should be able to analyse "real" traffic from MPG App.
Principle: Run Android MPG application on a rooted AVD (Android Virtual Device) emulator and capture traffic with proxy.
- Download and install Android Studio and HTTP Toolkit
- Run Android Studio and from More Actions > AVD manager, Create Virtual Device with Play Store, start it (Tested with:
Pixel4 PlayStore / Android 8.1 / x86
) - Root device with rootAVD (Note: Shutdown it with
adb shell reboot -p
then restart) - Install MPG application on device from Google Play Store
- Run HTTP Toolkit and select Android device connected via ADB (2nd click click could be necessary the first time to install VPN)
- Filter on url
api.mpg.football
- Run MPG App, signin and use it