PHP code example of uniondrug / service-sdk

1. Go to this page and download the library: Download uniondrug/service-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

uniondrug / service-sdk example snippets

text
    {
        .
        .
        "  "uniondrug/service-sdk" : "^3.0",
            .
            .
        },
        .
        .
        "scripts" : {
            "post-autoload-dump" : "Uniondrug\\ServiceSdk\\Bases\\Ide::builder"
        }
    }
    
text
    $response = $this->serviceSdk->module->user->login(["mobile" => "13966013721"]);
    if ($response->hasError()){
       echo $response->getError();
    } else {
       echo $response->toJson();
    }
    
text
    $this->serviceSdk->delete("http://wxapi.uniondrug.cn/v/user");
    $this->serviceSdk->get("http://wxapi.uniondrug.cn/v/user");
    
text
    $response = $this->serviceSdk->user->login(["mobile" => "13966013721"]);
    if ($response->hasError()){
       echo $response->getError();
    } else {
       echo $response->toJson();
    }