Code Monkey home page Code Monkey logo

open-sdk's Introduction

拍拍贷开放平台官方SDK

本文为拍拍贷开放平台JAVA版SDK的新手使用教程,只涉及教授SDK的使用方法,默认读者已经熟悉IDE的基本使用方法(本文以eclipse为例),以及具有一定的编程知识基础等。

官方SDK接入指南(Java为例)

前期准备

下载拍拍贷开放平台SDK

  • JAR包主要包含3部分内容: (其中,只有ppdai-openapi-sdk-1.0.jar是必须的) ppdai-openapi-sdk-1.0.jar(封装了如何调用OpenApi的通用方法) 请前往“工具下载页”下载最新SDK包

搭建开发环境

  • 在Eclipse中建立你的工程。

  • 在工程中新建一个libs目录,将开发工具包中libs目录下的ppdai-openapi-sdk-1.0.jar复制到该目录中(如下图所示,建立了一个名为testDemo右键单击工程”Properties→Java Build Path→Libraries→Add External JARs) dev

  • 自己搭建Maven私服形式,复制ppdai-openapi-sdk-1.0.jar到自己搭建的Maven私服,Maven的Pom.xml 增加如下配置 dev1

  • 这样你就可以开始使用sdk提供的方法了~

在代码中使用工具包

public AuthInfo Authorize (String appid,String code){
	AuthInfo authInfo = OpenApiClient.Authorize(appid,code);
}
  • 返回结果: 验证通过可获得实体类AuthInfo(ErrMsg[处理结果],OPENID,ACCESSTOKEN[登录令牌],REFRESHTOKEN[用于刷新TOKEN],EXPIRESIN[有效期])。 [3] ACCESSTOKEN有效期过期,根据REFRESHTOKEN刷新Token :OpenApiClient. RefreshToken()

结束

  • 至此,你已经能使用拍拍贷开放平台的SDK了。如果想更详细了解每个API函数的用法,请查阅 API接口参考手册, 或自行并可下载JAVA版SDK/ .NET版SDK 自行调试。

open-sdk's People

Contributors

ppd-xuzs avatar ppdai-open avatar seandot7 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.