Skip to content

Latest commit

 

History

History
276 lines (176 loc) · 6.82 KB

TasksApi.md

File metadata and controls

276 lines (176 loc) · 6.82 KB

crms.TasksApi

All URIs are relative to https://api.saasgrids.com/apis/crms/

Method HTTP request Description
createTask POST /{userId}/tasks Creates a new task
deleteTaskById DELETE /{userId}/tasks/{taskId} Delete task by Id
getAllTasks GET /{userId}/tasks Get all tasks
getTaskById GET /{userId}/tasks/{taskId} Get task by Id
updateTaskById PUT /{userId}/tasks/{taskId} Update task by Id

createTask

Task createTask(userId, body)

Creates a new task

Example

var crms = require('saasgrids');
var defaultClient = crms.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new crms.TasksApi();

var userId = "userId_example"; // String | User instance id returned from saasgrids after authorization

var body = new crms.Task(); // Task | Task object that needs to be created

apiInstance.createTask(userId, body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
userId String User instance id returned from saasgrids after authorization
body Task Task object that needs to be created

Return type

Task

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteTaskById

deleteTaskById(userId, taskId)

Delete task by Id

Example

var crms = require('saasgrids');
var defaultClient = crms.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new crms.TasksApi();

var userId = "userId_example"; // String | User instance id returned from saasgrids after authorization

var taskId = "taskId_example"; // String | ObjectId of task to be deleted

apiInstance.deleteTaskById(userId, taskId).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
userId String User instance id returned from saasgrids after authorization
taskId String ObjectId of task to be deleted

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getAllTasks

[Task] getAllTasks(userId, email)

Get all tasks

Example

var crms = require('saasgrids');
var defaultClient = crms.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new crms.TasksApi();

var userId = "userId_example"; // String | User instance id returned from saasgrids after authorization

var email = "email_example"; // String | Email id of the task

apiInstance.getAllTasks(userId, email).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
userId String User instance id returned from saasgrids after authorization
email String Email id of the task

Return type

[Task]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getTaskById

Task getTaskById(userId, taskId)

Get task by Id

Example

var crms = require('saasgrids');
var defaultClient = crms.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new crms.TasksApi();

var userId = "userId_example"; // String | User instance id returned from saasgrids after authorization

var taskId = "taskId_example"; // String | ObjectId of task

apiInstance.getTaskById(userId, taskId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
userId String User instance id returned from saasgrids after authorization
taskId String ObjectId of task

Return type

Task

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateTaskById

updateTaskById(userId, body, taskId)

Update task by Id

Example

var crms = require('saasgrids');
var defaultClient = crms.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new crms.TasksApi();

var userId = "userId_example"; // String | User instance id returned from saasgrids after authorization

var body = new crms.Task(); // Task | Task object that needs to be updated

var taskId = "taskId_example"; // String | ObjectId of task to be deleted

apiInstance.updateTaskById(userId, body, taskId).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
userId String User instance id returned from saasgrids after authorization
body Task Task object that needs to be updated
taskId String ObjectId of task to be deleted

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json