Weibo Java SDK Introduction and usage instructions

Source: Internet
Author: User

from: Sina Weibo open platform     @MUNTO_AKIRAhttp://open.weibo.com/blog/%e5%be%ae%e5%8d%9ajava-sdk%e4%bb% 8b%e7%bb%8d%e5%8f%8a%e4%bd%bf%e7%94%a8%e8%af%b4%e6%98%8e-2

Overview

The Weibo Java Platform SDK provides a document-friendly microblogging API call service for third-party microblogging applications, making it unnecessary for third-party clients to understand complex validation, API invocation procedures. and can realize the function of sharing to Weibo, can share text, or multimedia information to the built-in share page, and send to Weibo.

noun explanation

Overall architecture

1.src:weibo4j encapsulates most interfaces, including authorization, timeline, user and other common interfaces

Weibo4j.http contains the encapsulation of the HTTPS request

Weibo4j.model contains entity classes such as User,status.

Weibo4j.org.json various ways to complete JSON parsing

Weibo4j.util contains the tool classes required to request API interfaces

2.examples: Each test demo containing the package interface

Key interface Description 1. Get access tokens for Oauth2.0

2. Share to Weibo

Example Analysis 1. Authorized authentication

The first step is to fill in the configuration file:

Fill in the relevant configuration, app key, Secret, and Redirect_url.

The second step gets the code parameter:

Run the Oauth4code class, get code, the code that appears on the address bar after the user authorizes the login

The third step is to Exchange Access_token by code:

Through the acquisition of code, in exchange for Accesstoken, complete the authorization certification.

2. Share to Weibo

UpdateStatus class to run Com.example.timeline:

Fill in the Access_token and the microblogging content to be published after the authorization certification statuses

SDK FAQ Description

1.1. How to use the SDK

Select File->import->general->existing Projects into Workspace in Eclipse. Note: The encoding format for the SDK project is UTF-8

1.2. Common Errors

A 21321:applications over the unaudited use restrictions

Workaround: Fill out the test user in the application Console application information-"Advanced information-" test user

An unaudited app can only invoke the API interface by testing the user's identity

B Redirect_uri_mismatch: Callback address mismatch workaround: Off-Site Application: Application Console Application Information-"Advanced information-" Authorization settings to fill in the next callback address, you can also bind the domain name as a callback address

Station application: The address in the station as the callback address

Weibo Java SDK Introduction and usage instructions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.