Project

attask

0.0
No commit activity in last 3 years
No release in over 3 years
This gem is prepared to integrate with Attask
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.5

Runtime

~> 0.11
~> 2.18
~> 0.8
 Project Readme

Attask Ruby Client

This gem is an interface that allows you to make requisitions in the attask. Check it out the documentation.

Instalation

gem install attask
gem 'attask'

Usage

Configure the data access

Attask.configure do |config|
  config.username = ENV['ATTAKS_USERNAME']
  config.password = ENV['ATTAKS_PASSWORD']
end

Create a client

client = Attask::Client.new('app_name')

The app_name basically is the reference to mount the url e.g.: https://#{app_name}.attask-ondemand.com/api/v6.0

Queries

Queries allowed: eq, ne, gte, lte, isnull and contains.

Example of a query using the between query

object = 'TASK'

query = {
  'plannedCompletionDate'       => '$$TODAY-7',
  'plannedCompletionDate_Range' => '$$TODAY',
  'plannedCompletionDate_Mod'   => 'between'
}

client.search(object, query)

Fields

Retrieving the the field downloadURL

object = 'DOCU'
fields = ['downloadURL']
client.search('object', { objID: 'xxxxxxxx...' }, fields)

File upload

params = {
  name: 'teste.txt',
  description: 'descricao',
  docObjCode: 'TASK',
  objID: 'xxxxxxxx...'
}

client.upload(params, './teste.txt', 'text/plain')

Downloading files

# Retrieving a download_url

object = 'DOCU'
fields = ['downloadURL']
files = client.search('object', { objID: 'xxxxxxxx...' }, fields)
download_url = files[0]['downloadURL']

# It's optional
replace_filename = 'example.txt'

client.download(download_url, replace_filename)