Good afternoon, maybe someone from you has worked with the service (worksection.com), if not, I still want to ask for help, because I can't understand what I'm doing wrong.
And so, a brief introduction
- Access the API via http GET or POST request at http://your-domain.com/api/admin/ , where your-domain.com is the address of your Worksection account.
The request must contain the parameters:
action - operation
page - project url, task or subtask in the system without an account address For example: / project / 12345 /
hash is a verification record, formed as MD5 from the three glued parameters of the page, action, and your apikey key.
Apikey can get an account owner at http://your-domain.com/account/api/
An example of the formation of a test record for the php language: $hash = md5($page.$action.$apikey).
Text data must be encoded in UTF-8
- The answer is generated in JSON format, UTF-8 encoding
Next, I try to translate this into code -
import json import requests import hashlib adr = 'http://milkiweed.worksection.com/api/admin/' action = 'get_priority' page = 'project/205032/6086356/' apikey = 'e6***b080e162****88b5656***6d0' items = page + action + apikey hash = hashlib.md5(items.encode('utf-8')).hexdigest() r = requests.post(adr,json=hash) data = json.loads(r.text) print(data) When I start, I get an error - {'status': 'error', 'status_code': 0, 'message': 'Action is required'}
Based on the documentation, this error indicates that the request or verification record is not formed correctly.
Please tell me, most likely I’m not turning in the right way.
json=hashlooks suspicious. - jfshttp://your-domain.com/api/admin/?action=get_priority&hash=HASHHere is an example request for php - Milkiweed Gtlt