Skip to content

DataAPI SDK japanese MT.DataAPI Constructor

Taku AMANO edited this page Jul 5, 2013 · 13 revisions

コンストラクタ

パラメータ

パラメータ名 タイプ 必須 説明
options Object * Options.
options.clientId String * Client ID
This value allows alphanumeric, (_)underscore, (-)dash.
options.baseUrl String * The absolute CGI URL of the DataAPI.
(e.g. http://example.com/mt/mt-data-api.cgi)
options.format String * The format to serialize.
options.sessionStore String * The session store.
In browser, the cookie is used by default.
options.sessionDomain String * The session domain.
When using the cookie, this value is used as cookie domain.
options.sessionPath String * The session path.
When using the cookie, this value is used as cookie path.
options.async String * If true, use asynchronous XMLHttpRequest.
The default value is the true.
options.cache String * If false, add an additional parameter to request to avoid cache.
The default value is the false.
options.disableFormData String * If true, use FormData when available that.
The default value is the false.

Specify minimal options.

var api = new DataAPI({
  clientId: "your-client-id",
  baseUrl:  "https://your-host/your-mt-api.cgi"
});

Specify all options explicitly.

var api = new DataAPI({
  clientId: "your-client-id",
  baseUrl:  "https://your-host/your-mt-api.cgi",
  format: "json",
  sessionStore: "cookie",
  sessionDomain: "your-host",
  sessionPath: "/client-app/",
  async: true,
  cache: false,
  disableFormData: false
});

Using as a library for Node.js

var api = new DataAPI({
  clientId: "your-client-id",
  baseUrl:  "https://your-host/your-mt-api.cgi",
  sessionStore: "fs",
  sessionPath: "/home/your-login/.mt-data-api.json"
});

Clone this wiki locally