All social networks providing APIs over http are accessible through scripts using apsdb.callHttp.
However, popular networks already have API calls available from the scripting environment, under the “social” object.
You can also check the social networking utility scripts that are provided to you here.
All available APIs are accessible from apsdb.social.socialNetworkName. Each of these APIs includes some first class methods that can be called directly on the provided object, and two other methods to allow calling all other APIs that the network provides.
Each network has the following methods:
an authorization url: url that the user needs to be redirected to in order for him to authorize the application to access his account/resources
a request token
a request token secret
Note: Facebook doesn't use a request token/secret but instead counts on the developer providing a “state” string to identify the request
Once the user authorizes the application, the networks issue a callback to a certain url, passing an oauth verifier parameter. The oauth verifier parameters is then used by this method to exchange the request token / request token secret by a pair of access token / access token secret, used in all api requests
Each network has a large number of APIs, all callable the same way, differentiated by a “resource url”. CallApi allows the developer to take advantage of the oAuth signing process and all new APIs that the networks provides. CallApi requires:
application identifiers (consumer key, consumer secret)
user identifiers (access token, access secret)
api specific parameters (page, count, searchString...)
CallApi will perform the signing and calling of the http api and return a json object containing the response from the network.
Same as callApi, getApiCall is available for all network specific APIs which don't have first level methods implemented in apstrata.
GetApiCall is used for cases where the developer wants to call from a client (browsers, other servers) and not from inside the apstrata scripting environment. GetApiCall will return a signed url and a string containing the form encoded set of parameters that were passed to the method.