Skip to content

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.

Capture requests GET content with command line

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 .

Capture API SSL traffic from mobile MPG App

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.

  1. Download and install Android Studio and HTTP Toolkit
  2. 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)
  3. Root device with rootAVD (Note: Shutdown it with adb shell reboot -p then restart)
  4. Install MPG application on device from Google Play Store
  5. Run HTTP Toolkit and select Android device connected via ADB (2nd click click could be necessary the first time to install VPN)
  6. Filter on url api.mpg.football
  7. Run MPG App, signin and use it