">mixi Developer Center (mDC)

mixi Connect

mixi Connect (English) » mixi Graph API » mixi API SDK for Android™ » Using APIs » Sample API requests

Sample API requests

Sample codes for the APIs are listed below.
For details of each API, such as the description of the required parameters and the return value, please refer to the information on the technical specifications page.

People API

Obtaining information about a user

mContainer.send("/people/@me/@self", new CallbackListener() {});

Obtaining a list of "my mixi" (friends) of a user

mContainer.send("/people/@me/@friends", new CallbackListener() {});

Obtaining information by specifying the fields

Map params = new HashMap();
params.put("fields", "thumbnailUrl profileUrl");
params.put("sortBy", "displayName");
params.put("sortOrder", "ascending");

mContainer.send("people/@me/@friends", params, new CallbackListener() {});

Groups API

mContainer.send("/groups/@me", new CallbackListener() {});

People lookup API

HashMap params = new HashMap();
params.put("q", "someone@example.com");
params.put("field", "id,displayName");
params.put("startIndex", "1");
params.put("count", "50");

mContainer.send("/search/people", params, new CallbackListener() {});

Updates API

Map params = new HashMap();
params.put("fields", "voice,diary,profile");
params.put("copunt", "50");
params.put("startIndex", "1");
params.put("updatedSince", Util.dateToString(date));

mContainer.send("/updates/@me/@self", params, new CallbackListener() {});

Voice API

Obtaining a list of tweets of "my mixi" (friends)

mContainer.send("/voice/statuses/@me/friends_timeline", new CallbackListener() {});

Obtaining a tweet

Map params = new HashMap();
params.put("status", "Hello.");
mContainer.send("/voice/statuses/update", HttpMethod.POST, params, new CallbackListener() {});

Obtaining a tweet with a photo

String contentType="image/jpeg";
String status = "Hello.";
InputStream is = new FileInputStream("image.jpg");
mContainer.send("/voice/statuses/update?status=" + status, contentType,
        is, is.available(), new CallbackListener() {});

Photo API

Obtaining a list of photos of "my mixi" (friends)

mContainer.send("/photo/mediaItems/@me/@friends", new Listener());

Obtaining a photo

String contentType="image/jpeg";
InputStream is = new FileInputStream("image.jpg");

mContainer.send("/photo/mediaItems/@me/@self/@default", contentType, is,
        is.available(), new CallbackListener() {});

TOP OF THIS PAGE