Skip to content
This repository was archived by the owner on Oct 9, 2018. It is now read-only.

Commit 135b258

Browse files
author
Maksym Novozhylov
committed
add Accept/Decline an Offer API
1 parent ba76db2 commit 135b258

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

README.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
:target: http://badge.fury.io/py/python-odesk
77
:alt: PyPI version
88

9+
.. image:: https://travis-ci.org/odesk/php-odesk.svg
10+
:target: http://travis-ci.org/odesk/php-odesk
11+
:alt: Build status
12+
913
Copyright (c) 2010-2014, oDesk http://www.odesk.com
1014
All rights reserved.
1115

changelog.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
Changelog
66
***************
77

8+
.. _0.5.7:
9+
10+
Version 0.5.7
11+
-------------
12+
* Added new API call - :py:meth:`Accept or decline an offer <odesk.routers.offers.Offers.accept_or_decline>`.
13+
* Added new conditionally required parameter ``category2`` to :py:meth:`Post job <odesk.routers.hr.HR.post_job>` API.
14+
815
.. _0.5.6:
916

1017
Version 0.5.6

odesk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
1414
"""
1515

16-
VERSION = '0.5.6'
16+
VERSION = '0.5.7'
1717

1818

1919
def get_version():

odesk/routers/offers.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,20 @@ def get_freelancer_offer(self, offer_id):
245245

246246
url = 'contractors/offers/{0}'.format(offer_id)
247247
return self.get(url, data)
248+
249+
def accept_or_decline(self, offer_id, action_name):
250+
"""
251+
Get specific offer as freelancer.
252+
253+
*Parameters:*
254+
:offer_id: Offer reference ID.
255+
256+
:action_name: The name of the action to run.
257+
258+
"""
259+
data = {}
260+
261+
data['action_name'] = action_name
262+
263+
url = 'contractors/actions/{0}'.format(offer_id)
264+
return self.post(url, data)

0 commit comments

Comments
 (0)