js/cloudmine.js
function(query, options) {
      options = opts(this, options);

      if(!options.session_token) throw new Error("Must be logged in to perform a social query");
      if(query.headers && !isObject(query.headers)) throw new Error("Headers must be an object");
      if(query.params && !isObject(query.params)) throw new Error("Extra parameters must be an object");

      var url = "social/"+query.network+"/"+query.endpoint;

      var urlParams = {};

      if(query.headers) urlParams.headers = query.headers;
      if(query.params) urlParams.params = query.params;

      var apicall = new APICall({
        action: url,
        type: query.method,
        query: urlParams,
        options: options,
        data: query.data,
        contentType: 'application/octet-stream'
      });

      return apicall;
    }
function(query, options) {
      options = opts(this, options);

      if(!options.session_token) throw new Error("Must be logged in to perform a social query");
      if(query.headers && !isObject(query.headers)) throw new Error("Headers must be an object");
      if(query.params && !isObject(query.params)) throw new Error("Extra parameters must be an object");

      var url = "social/"+query.network+"/"+query.endpoint;

      var urlParams = {};

      if(query.headers) urlParams.headers = query.headers;
      if(query.params) urlParams.params = query.params;

      var apicall = new APICall({
        action: url,
        type: query.method,
        query: urlParams,
        options: options,
        data: query.data,
        contentType: 'application/octet-stream'
      });

      return apicall;
    }
function ( query , options ) { options = opts ( this , options ) ; if ( ! options . session_token ) throw new Error ( "Must be logged in to perform a social query" ) ; if ( query . headers && ! isObject ( query . headers ) ) throw new Error ( "Headers must be an object" ) ; if ( query . params && ! isObject ( query . params ) ) throw new Error ( "Extra parameters must be an object" ) ; var url = "social/" + query . network + "/" + query . endpoint ; var urlParams = { } ; if ( query . headers ) urlParams . headers = query . headers ; if ( query . params ) urlParams . params = query . params ; var apicall = new APICall ( { action : url , type : query . method , query : urlParams , options : options , data : query . data , contentType : 'application/octet-stream' } ) ; return apicall ; }
Query a social network.
Must be logged in as a user who has logged in to a social network.
@param {object} query An object with the parameters of the query.
@config {string} query.network A network to authenticate against. @see WebService.SocialNetworks
@config {string} query.endpoint The endpoint to hit, on the social network side. See the social network's documentation for more details.
@config {string} query.method HTTP verb to use when querying.
@config {object} query.headers Extra headers to pass in the HTTP request to the social network.
@config {object} query.params Extra parameters to pass in the HTTP request to the social network.
@config {string} query.data Data to pass in the body of the HTTP request.
@param {object} [options] Override defaults set on WebService. See WebService constructor for parameters.
@throws {Error} If the user is not logged in.
@throws {Error} If query.headers is truthy and not an object.
@throws {Error} If query.params is truthy and not an object.
@return {APICall} An APICall instance for the web service request used to attach events.
Query a social network . Must be logged in as a user who has logged in to a social network .