Get a signmii
Getting a signmii returns the encoding of a digital digest which is timestamped and serialized.
Generating 1 signmii by program costs 1 credit. To buy credit units, click on the cart in the banner of your home page.
IMPORTANT: Always keep the original file and its signmii together on your system.
Download the code of the sendget
function defined in the file sendhttp.php.
Copy the file in the space of your application.
NOTE: See the page Call the service API for a description of the sendget
function.
URL
https://signmii.com/api/getsignmii?login=&password=&sha1=
login | Your identification code. |
---|---|
password | Your password. |
sha1 | SHA1 digital digest to encode. |
sha1
is a SHA1 digest in hexadecimal,
a string of 40 characters composed with digits and the letters a to f or A to F.
Add the file getsignmii.php with the following content:
- require_once 'sendhttp.php';
Loads the code of the sendget
function provided by iZend.
- function getsignmii($login, $password, $sha1) {
Defines the function getsignmii
.
$login
is your identification code. $password
is your password.
$sha1
is the SHA1 digest to encode.
- $curl = 'https://signmii.com/api/getsignmii';
- $args = array(
- 'login' => $login,
- 'password' => $password,
- 'sha1' => $sha1,
- );
Sets $curl
to the URL of the getsignmii action.
Fills the array $args
with the parameters of the getsignmii action.
NOTE: Replace http
by https
in the URL to encrypt the communication.
- $response=sendget($curl, $args);
Sends the HTTP request with sendget
.
- if (!$response or $response[0] != 200) {
- return false;
- }
If $response
is false
, the server is unreachable.
If $response[0]
doesn't contain the HTTP return code 200 Ok, an execution error has occurred.
In case of error, getsignmii
returns false.
- return $response[2];
- }
Returns the body of the response, i.e. the signmii.
EXAMPLE
Assuming you have saved the files sendhttp.php and getcredit.php in the current directory, run PHP in interactive mode, generate a SHA1 digest with the PHP function sha1
, load the getcredit
function and call it with your identification code, your password and the SHA1 in argument:
$ php -a
php > $sha1=sha1('signmii');
php > echo $sha1;
ed0847ae3231350b0153cd8b9c8f56b87ab37801
php > require_once 'getsignmii.php';
php > $signmii=getsignmii('abcdef', 'ABCDEF', $sha1);
php > echo $signmii;
uIWPRlfPaB8VgkTHIg8IoTe72WtTLgL_vGoWjY8PfM9fFjwXb8LmvMsMGKVUUTvJOy-z536BC-GMCOaDDdHhcWqGEYyUlXULwwGBXQL7drGnnbTa0H4bCD1YME6H9q7xIdMqlD9pIS-CIAsAo1SYguOhHP9bBlZ_7vk91gmKmxJQi6ril_UlvUmvmjJbUSnoyvDBLPcOWTa0hPDiPKnLifaimHHzkKfLtD9Ck2DAam9G3q3ME0zayVOTTlFdyPsOwvM6SvOMqAi-iBV40Bg5Ky4wKJztDMiCCBCdx3k-jvMfVtZM61MoIDNaICeI59UYE-HL8cPX3CcRphXYdFmRHg
php > quit
Comments