">mixi Developer Center (mDC)

mixi Apps

mixi Apps (English) » Technical Specification » PC » Let's post mixi Voice

Let's post mixi Voice

Using the mixi Voice API, you are able to post mixi Voice chat from the mixi app to the user. Because of that, the user can easily post the various experiences on the mixi app for communication with friends.

Attention to implement mixi Voice

Please observe the following rule to use this API.

  • The trigger to call the Voice posting execution must use the image (click to download) that our company specifies as the button. Please implement and call the requestUpdateStatus() function when it is clicked.

Preparing to use the mixi Voice API

You need to previously prepare for using the Voice API

Posting mixi Voice

Please list the following codes for execution of the actual posting. The execution must use the image (click to download) that our company specifies as the button and implement the call when it is clicked. Besides, using this image is prohibited other than mixi Voice for the mixi app.

icon_voice.gifThe posting button for mixi Voice
var params = {};
params[mixi.Status.Field.URL] =
        "http://mixi.jp/run_appli.pl?id=[アプリID]&appParams=...";
params[mixi.Status.Field.MOBILE_URL] =
        "http://ma.mixi.net/[アプリID]/?url=...";
params[mixi.Status.Field.TOUCH_URL] =
        "http://mixi.jp/run_appli.pl?id=[アプリID]&appParams=...";
mixi.requestUpdateStatus("こんなに育ちました!", function(response) {
  if (response.hadError()) {
    var code = response.getErrorCode();
    var msg = response.getErrorMessage();
    // エラー時の処理
  } else {
    // 成功時の処理
  }
}, params);

Calling the requestUpdateStatus() function, the pop-up window to prompt the user to type the content of Voice. Clicking the つぶやく button or the closing button, the callback function given by the argument is called after the pop-up window is closed.

Specifying the 1st argument for the strings, the default value of the content of the Voice can be set. The number of specified characters in the 1st argument is limited to 107 characters if the URL is specified or 130 characters if the URL is not specified.

Calling the hadError() function of the argument given to the callback function allows you to check whether the posting is properly executed. If true is returned, please implement the proper error execution (such as displaying the post error). Calling the getErrorCode() function and getErrorMessage() function, you can find the cause.

In the 3rd argument, you need to specify the URL that you want to include in mixi Voice. The specified URL is shown below. The 3rd argument can be omitted.

  • URL: the app start URL for PCs
  • MOBILE_URL: the app start URL for mobile devices
  • TOUCH_URL: the app start URL for smartphones

Each URL can only be specified to run the app. For example, the app for PCs can be described as the following URL http://mixi.jp/run_appli.pl?id=12345. However, because the end of the URL can be free, the parameter can be given by describing the query parameter, such as appParam, when the app is run. Specifying the URL, the short URL that represents them is automatically given to the posted Voice.

The error codes and error messages are as shown below.

Error code Error message Circumstance
401 Insufficient scope User permission was not obtained for mixi_apps2 scope.
403 Forbidden When posting, mixi Voice is forbidden.
403 User canceled When the user canceled the posting.
500 Internal server error A mixi internal error.

 

TOP OF THIS PAGE