Table Of Contents

Previous topic

SL3 Cloud User API

Next topic

Possible errors

API functions

add_hash

Adds new hash to queue.

method:POST

Params:

apikey:your API Key
imei:IMEI number
hash:Hash (Hash must be exactly 40 chars (0-9, A-F))
parts:number of parts, can be one of: 100, 200, 500 and 1000
description:Hash description
method:calculation method: a for 0..100, d for 100..0 and r for random
email:result will be send on this address
email_lang:email content language

Example:

curl 'http://app.servmg.com/en/hcloud/uapi1/add_hash/' \
  --data-urlencode apikey='1234' \
  --data-urlencode imei='123456789012347' \
  --data-urlencode hash='0000111122223333444455556666777788889999' \
  --data-urlencode parts='100' \
  --data-urlencode description='New hash' \
  --data-urlencode method='a' \
  --data-urlencode email='test@test.com' \
  --data-urlencode email_lang='en'

Response:

{
    "ok": true,
    "response": "Hash has been added",
    "hash_id": 103
}

del_hash

Removes hash from queue.

method:POST

Params:

apikey:your API Key
id:ID of hash (as returned by add_hash or processing_list)

Example:

curl 'http://app.servmg.com/en/hcloud/uapi1/del_hash/' --data-urlencode apikey='1234' --data-urlencode id='1'

Response:

{
    "ok": true,
    "response": "Hash has been deleted."
}

processing_list

Returned list of hashes to calculate.

method:GET

Note

This function is available only if you are managing your own computing cloud. If you are using credits you will not be able to use it.

Example:

curl 'http://app.servmg.com/en/hcloud/uapi1/processing_list/?apikey=1234&page=1'

Response:

{
    "processing_list": [
        {
            "imei": "35XXXXXXXXXXXXX",
            "percent_done": 0,
            "parts": 0,
            "id": 2
        },
        {
            "imei": "12XXXXXXXXXXXXX",
            "percent_done": 0,
            "parts": 0,
            "id": 3
        },
        {
            "imei": "12XXXXXXXXXXXXX",
            "percent_done": 0,
            "parts": 0,
            "id": 101
        },
        {
            "imei": "12XXXXXXXXXXXXX",
            "percent_done": 0,
            "parts": 0,
            "id": 102
        }
    ],
    "ok": true
}

get_nck

Returns NCK result.

method:GET

Params:

apikey:your API key
id:ID of hash (as returned by add_hash or processing_list)

Example:

curl 'http://app.servmg.com/en/hcloud/uapi1/get_nck/?apikey=1234&id=1'

If hash is calculated response will be:

{
    "ok": true,
    "response": "#pw+0886 ... 5627+7#"
}

If has is not yet calculated, the result of NCK code will be empty:

{
    "ok": true,
    "response": ""
}

Possible errors:

get_cod1

Returns COD result.

method:GET

Params:

apikey:your API key
id:ID of hash (as returned by add_hash or processing_list)

Example:

curl 'http://app.servmg.com/en/hcloud/uapi1/get_cod1/?apikey=1234&id=1'

If hash is calculated response will be:

{
    "ok": true,
    "response": "d51b ... 402"
}

If has is not yet calculated, the result of NCK code will be empty:

{
    "ok": true,
    "response": ""
}

Possible errors:

get_cod2

Returns COD2 result.

method:GET

Params:

apikey:your API key
id:ID of hash (as returned by add_hash or processing_list)

Example:

curl 'http://app.servmg.com/en/hcloud/uapi1/get_cod2/?apikey=1234&id=1'

If hash is calculated response will be:

{
    "ok": true,
    "response": "[IMEI]\n12 ... 402"
}

If has is not yet calculated, the result of NCK code will be empty:

{
    "ok": true,
    "response": ""
}

Possible errors:

check_nck

Returns NCK status/result.

method:GET

Params:

apikey:your API key
imei:IMEI number

Example:

curl 'http://app.servmg.com/en/hcloud/uapi1/check_nck/?apikey=1234&imei=123456789012347'

If hash is calculated response will be:

{
    "ok": true,
    "status": "complete",
    "response": "#pw+0886 ... 5627+7#"
}

If hash is calculated, but there is no result, response will be:

{
    "ok": true,
    "status": "complete",
    "response": "Code not found"
}

If has is not yet calculated, response will be (with remaining time):

{
    "ok": true,
    "status": "processing",
    "time_to_complete": 86400.0
}

queue_time

Returns times of hashes which you want to calculate.

method:GET

Params:

apikey:your API key
id:ID of hash (as returned by add_hash or processing_list)

Example:

Time to calculate one hash:

curl 'http://app.servmg.com/en/hcloud/uapi1/queue_time/?apikey=1234&plus=1'

Response (queue_time_hr: queue time human readable, queue_time_seconds: the same, but in seconds):

{
    "ok": true,
    "queue_time_hr": "120 hours 0 minutes 0 seconds",
    "queue_time_seconds": 432000
}

Time to calculate two hashes:

curl 'http://app.servmg.com/en/hcloud/uapi1/queue_time/?apikey=1234&plus=2'

Response:

{
    "ok": true,
    "queue_time_hr": "144 hours 0 minutes 0 seconds",
    "queue_time_seconds": 518400
}

change_imei_order

Reorders IMEI numbers.

method:POST

Note

This function is available only if you are managing your own computing cloud. If you are using credits you will not be able to use it.

Params:

apikey:your API key
order:comma separated hashes ID, e.g. ‘4,1,3,2’

Example:

Hashes will be in the order as given in the ‘order’.

curl 'http://app.servmg.com/en/hcloud/uapi1/change_imei_order/' --data-urlencode apikey='1234' --data-urlencode order='4,1,3,2'

Response:

{
    "ok": true,
    "response": "Done"
}

get_credits_count

Get current credit count on your account.

method:GET

Params:

apikey:your API key

Example:

curl 'http://app.servmg.com/en/hcloud/uapi1/get_credits_count/?apikey=1234'

Result will contain:

{
    "ok": true,
    "credits": 1
}