Page MenuHomePhabricator

Conduit.connect works, but maniphest.createtask doesn't
Closed, InvalidPublic

Description

Hi, I am trying to use the conduit api via javascript.
First I connect - and it works:

POST to ../api/conduit.connect

params:{"client":"My Conduit","clientVersion":1,"clientDescription":"Conduit Connector","user":"sales","host":"http://phab.com/api","authToken":1417182709,"authSignature":"4fdcdfcb61231f33e07fa44447ba8714788c509c"}
__conduit__:true

Response:

{"result":{"connectionID":58,"sessionKey":"j3sk2uoqkaeuqqdlh6vfxvgztvqhxxodufr72dgf","userPHID":"PHID-USER-htxrhffjj2f3v6lu3cyo"},"error_code":null,"error_info":null}

Next step:
POST to ../api/maniphest.createtask

params:{"title":"Test 3","description":"Test"}
__conduit__:{"sessionKey":"j3sk2uoqkaeuqqdlh6vfxvgztvqhxxodufr72dgf","connectionID":58}
output:json

Results in:

{"result":null,"error_code":"ERR-CONDUIT-CORE","error_info":"You are trying to save some data to Phabricator, but the request your browser made included an incorrect token. Reload the page and try again. You may need to clear your cookies.\n\nThis was a Web request.\nThis request had no CSRF token."}

I searched for many hours, looked at source-codes of other clients, but nothing helps.

How can I get a CSRF token?

Event Timeline

cgaeking raised the priority of this task from to Needs Triage.
cgaeking updated the task description. (Show Details)
cgaeking updated the task description. (Show Details)
cgaeking updated the task description. (Show Details)
cgaeking added a subscriber: cgaeking.
chad claimed this task.

Please check out IRC if you need help extending Phabricator. irc.freenode.net #phabricator

um .. i tried, but there noone ever answers or reacts :/

Typically Monday - Friday 8am - 8pm, Pacific Time. Its been a holiday week so unlikely anyone was working.

Ah ok. Good to know.
In the meanwhile I figured out that I could call https://secure.phabricator.com/login/refresh/
maybe..
Although I must say you have a strange understanding of creating a json... (Just try that link ;)