General information🔗
Connecting to API🔗
- URL for connection: https://mrgs.astrum.team/pub/s2s.php
- URL for testing: https://mrgs.astrum.team/pub/s2s_test.php
| Parameter | Method | Value | Mandatory | Type | Description |
|---|---|---|---|---|---|
| action | GET | device_info | yes | string | Request command |
| appId | GET | 38 | yes | number | Application ID |
| hash | GET | 00d0f8f01cff64ab2e8f2a4122b318b1 | yes | string | Request signature. md5(all parameters, in alphabetical order + application secret key) |
| format | GET | json | no | string | Sever response format |
Response format🔗
| Parameter | Description |
|---|---|
| json | Returns JSON (default) |
| php | PHP serialization |
| amf | AMF3 binary format |
Response🔗
If the status parameter equals 0, then the request was successful. If status is less than 0 - en error occurred. The error text will be in the error parameter.
In the case of an error, the result parameter will be an empty array.
Signature check🔗
Hash is calculated on accordance with the following rules. All parameters of the GET request are sorted alphabetically (by keys) and merged in a string through http_build_query(). After that, the & symbol and the application secret key are added to the string. After that, MD5 is taken from the resulting string.
Example🔗
/pub/s2s.php?action=device_info&appId=38&format=json&openUDID=7a094faa0667549d6d39d65b1736d0be064730c4&hash=598b6a8f699da98cf68021c261c21eb2
$GET = array(
'appId' => 38,
'action' => 'device_info',
'format' => 'json',
'openUDID' => '7a094faa0667549d6d39d65b1736d0be064730c4',
);
ksort($GET);
$GETString = http_build_query($GET); // action=device_info&appId=38&format=json&openUDID=7a094faa0667549d6d39d65b1736d0be064730c4
$hash = md5($GETString.'&'.$server_secret_key); // md5('action=device_info&appId=38&format=json&openUDID=7a094faa0667549d6d39d65b1736d0be064730c4&'.'CeWMmaBX6hIvxxCs2qXlPKwjxl4YscD5') for security purposes, the secret key has been changed in the example.
Response
array (
'status' => 0,
'error' => '',
'result' =>
array (
'id' => '7a094faa0667549d6d39d65b1736d0be064730c4',
'deviceName' => 'iPhone Simulator',
'country' => 'RU',
'platform' => 'x86_64',
'odin1' => 'dfb7f341235ffa1d2b3e13eaa63fb1d658390b0c',
'displayHeight' => '568',
'displayWidth' => '320',
'language' => 'en',
'localizedModel' => 'iPhone Simulator',
'memoryMax' => '8192.00',
'model' => 'iPhone Simulator',
'systemName' => 'iPhone OS',
'systemVersion' => '6.0',
'timeZone' => '+0400',
'reachability' => '2',
'carrier' => '',
'isPayment' => '1',
'isTest' => '1',
'ip' => '1599402021',
'flags' => '1',
'registerTime' => '1353585172',
'lastActiveTime' => '1355346237',
'atime' => '1355346436',
'location' =>
array (
'id' => '7a094faa0667549d6d39d65b1736d0be064730c4',
'City' => 'Moscow',
'Country' => 'Russia',
'CountryCode' => 'RU',
'Name' => 'Leningradsky Prospekt 45b5',
'State' => 'Moscow',
'Street' => 'Leningradsky Prospekt 45b5',
'SubAdministrativeArea' => 'Moscow',
'SubThoroughfare' => '45b5',
'Thoroughfare' => 'Leningradsky Prospekt',
'ZIP' => '125167',
'latitude' => '55.79766',
'longitude' => '37.53194',
'ctime' => '1355346232',
'atime' => '1355346436',
),
'applications' =>
array (
1 =>
array (
'id' => '16',
'deviceId' => '7a094faa0667549d6d39d65b1736d0be064730c4',
'applicationId' => '38',
'applicationVersion' => '1.1',
'applicationBuild' => '700',
'country' => 'RU',
'displayName' => 'MRGServiceExample',
'identifier' => 'ru.akeb.MRGServiceExample',
'name' => 'MRGServiceExample',
'memoryUse' => '24.04',
'registerTime' => '1353585172',
'lastActiveTime' => '1355346237',
'isPayment' => '0',
'atime' => '1355346436',
),
),
'token' =>
array (
),
),
)
Common error codes for all requests🔗
| Code | Description |
|---|---|
| 0 | No errors |
| -1 | No signature! |
| -2 | No application! |
| -3 | No command! |
| -4 | No such command! |
| -5 | No such format! |
| -6 | No such application! |
| -7 | Wrong signature! |
Last update: 2025-01-21
Created: 2020-01-16
Created: 2020-01-16