Methods to interact with authorized web services.
int
callWebService
(
service
,
handler
)
openmail.Application.callWebService, but will
add any authorization information needed to make the call.
service
< Object >
It may include the following:
url: String Target URLmethod: String "GET" or "POST" parameters: Object A map of key/value pairs to use
as the query string or the POST body. headers: Array of strings An array of HTTP headers
as strings. You can set any arbitrary headers if it is accepted by
cross-domain policy file. Content-Type header is always accepted.
It is only supported for "POST"body: String Use when POSTing stringified JSON data
with ['content-type:application/json'] header,
or when POSTing data with
['content-type:multipart/form-data'] headerdataformat: String "text"(default) or "binary".
"binary" returns Base64-encoded binary data.handler
< function >
A callback function.
Callback response
Object contains the following data:
response.data contains the HTTP body
returned by the Web service.response.error contains an error
message describing the failure.
int
private
AuthService
getAuthService
(
)
AuthService
int
getParameters
(
handler
)
handler
< function >
A callback function. Callback response
Object has an object response.user
This object has following members:
int
Object
getStatus
(
handler
)
handler
< function >
A callback function.
Object
status:
One of following: 'ok', 'failed',
or 'authorization required'.info: If status
is 'ok', depending on the profile type,
data holds some additional information.
Object
getUserAuthorizationURL
(
params
,
handler
)
params
< Object >
An object containing the configuration of the
auth service requested. Object has following
members:
request: Properties of
the request object will be added
the call for request token.authorization: Properties
of the request object will be added to
authorization URL.handler
< function >
A callback function.
Object
url: The authorization URL.
Object
notifyAuthorizationReceived
(
handler
)
handler
< function >
A callback function.
Object
info: Additional information,
returned by the service.
Object
removeAuthorization
(
handler
)
handler
< function >
A callback function.
Object