API Docs for: 1.0.1
Show:

File: lib/routers/hr/engagements.js

  1. /**
  2. * Upwork auth library for using with public API by OAuth
  3. *
  4. * @package UpworkAPI
  5. * @since 09/24/2014
  6. * @copyright Copyright 2014(c) Upwork.com
  7. * @author Maksym Novozhylov <mnovozhilov@upwork.com>
  8. * @license Upwork's API Terms of Use {@link https://developers.upwork.com/api-tos.html}
  9. */
  10.  
  11. /**
  12. * @module routes.hr.engagements
  13. */
  14.  
  15. /**
  16. * @property entryPoint
  17. * @type String
  18. * @default api
  19. * @static
  20. * @final
  21. */
  22. var entryPoint = 'api';
  23.  
  24. /**
  25. * @class Engagements
  26. * @constructor
  27. */
  28. exports.Engagements = function(api) {
  29. this.api = api;
  30. this.api.epoint = entryPoint;
  31. }
  32.  
  33. /**
  34. * Get list of engagements
  35. *
  36. * @method getList
  37. * @param params {Hash} Parameters
  38. * @param callback {String} Callback function
  39. * @async
  40. */
  41. exports.Engagements.prototype.getList = function(params, callback) {
  42. debug('running request');
  43. this.api.client.get('hr/v2/engagements', params, callback);
  44. }
  45.  
  46. /**
  47. * Get specific engagement
  48. *
  49. * @method getSpecific
  50. * @param reference {Integer} Engagement reference
  51. * @param callback {String} Callback function
  52. * @async
  53. */
  54. exports.Engagements.prototype.getSpecific = function(reference, callback) {
  55. debug('running request');
  56. this.api.client.get('hr/v2/engagements/' + reference, {}, callback);
  57. }
  58.