youzan/open-sdk-php

Name: open-sdk-php

Owner: ??

Description: ?????? PHP?SDK

Created: 2017-10-30 07:37:39.0

Updated: 2018-05-01 11:11:20.0

Pushed: 2017-10-30 08:38:18.0

Homepage: https://www.youzanyun.com/apilist

Size: 7

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

open-sdk-php

Latest Version on Packagist Software License Total Downloads

Youzan Open SDK

Install

Via Composer

mposer require youzan/open-sdk
Usage
1. ?? accessToken
?????
ire_once './vendor/autoload.php';

entId = "fill your client_id";
entSecret = "fill your client_secret";
irectUrl = "fill your redirect_url";

e = 'oauth';  //????access_token?type??refresh_token
s['code'] = $_GET['code'];  //????access_token????$keys['refresh_token']
s['redirect_uri'] = $redirect_url;

essToken = (new \Youzan\Open\Token($clientId, $clientSecret))->getToken($type, $keys);
dump($accessToken);
?????
ire_once './vendor/autoload.php';

entId = "fill your client_id";
entSecret = "fill your client_secret";

e = 'self';
s['kdt_id'] = '160';

essToken = (new \Youzan\Open\Token($clientId, $clientSecret))->getToken($type, $keys);
dump($accessToken);
??????????token
ire_once './vendor/autoload.php';

entId = "fill your client_id";
entSecret = "fill your client_secret";

e = 'platform_init';

essToken = (new \Youzan\Open\Token($clientId, $clientSecret))->getToken($type);
dump($accessToken);
?????????token
ire_once './vendor/autoload.php';

entId = "fill your client_id";
entSecret = "fill your client_secret";

e = 'platform';
s['kdt_id'] = '160';

essToken = (new \Youzan\Open\Token($clientId, $clientSecret))->getToken($type, $keys);
dump($accessToken);
2. ??????1
ire_once './vendor/autoload.php';
essToken = 'fill your token';
ent = new \Youzan\Open\Client($accessToken);

hod = 'youzan.item.get';
Version = '3.0.0';

ams = [
'alias' => 'fa8989ad342k',


ponse = $client->get($method, $apiVersion, $params);
dump($response);
2. ??????2
ire_once './vendor/autoload.php';
essToken = 'fill your token';
ent = new \Youzan\Open\Client($accessToken);

hod = 'youzan.materials.storage.platform.img.upload';
Version = '3.0.0';

ams = [
'alias' => 'fa8989ad342k',


es = [
[
    'url' => __DIR__ . '/test1.png',
    'field' => 'image[]',
],


ponse = $client->post($method, $apiVersion, array(), $files);
dump($response);
Change log

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security related issues, please using the issue tracker.

License

The MIT License. Please see License File for more information.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.