Conduit Maniphest edit API giving an error

Maniphest edit is working fine when it’s used from https://localhost:8080/conduit/method/maniphest.edit/ . When we use the same from Postman/cURL then it’s not working.

It’s always giving the same error

{
"result": null,
"error_code": "ERR-CONDUIT-CORE",
"error_info": "Parameter \"transactions\" is not a list of transactions."
}

Request Detail:

 curl -X POST \
  http://localhost:8080/api/maniphest.edit \
  -H 'Accept: */*' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'User-Agent: PostmanRuntime/7.15.0' \
  -H 'accept-encoding: gzip, deflate' \
  -d 'transactions=%5B%7B%22type%22%3A%22title%22%2C%22value%22%3A%22Testing%20AutoBug%22%7D%2C%7B%22type%22%3A%22description%22%2C%22value%22%3A%22This%20is%20a%20test.%22%7D%2C%7B%22type%22%3A%22status%22%2C%22value%22%3A%22open%22%7D%2C%7B%22type%22%3A%22priority%22%2C%22value%22%3A%22triage%22%7D%2C%7B%22type%22%3A%22projects.set%22%2C%22value%22%3A%5B%22PHID-PROJ-lak2hnems3jq4srot3za%22%5D%7B%22type%22%3A%22comment%22%2C%22value%22%3A%22Test%20comment%22%7D%5D&objectIdentifier=%22T1%22&output=json&api.token=api-hoqfusu2ndqck4jbhmbqgp4loojj'

What’s the reason for this error?

Encoded form data is as below:

{
"transactions": [
    {
        "type": "title",
        "value": "Testing AutoBug"
    },
    {
        "type": "description",
        "value": "This is a test."
    },
    {
        "type": "status",
        "value": "open"
    },
    {
        "type": "priority",
        "value": "triage"
    },
    {
        "type": "projects.set",
        "value": ["PHID-PROJ-lak2hnems3jq4srot3za"]
    },
    {
        "type": "comment",
        "value": "Test comment"
    }
],
"objectIdentifier": "T1",
"output": "json",
"api.token": "api-hoqfusu2ndqck4jbhmbqgp4loojj"
}

The data in the last code section doesn’t match the data in the curl command (your input is not json, for one thing, and the “encoded form data” is).

At the bottom of https://localhost:8080/conduit/method/maniphest.edit/ result view there’s a section marked “curl” that shows the equivalent request. Did you compare that section to the request you’re making?

I guess you’re referring mismatch in objectIdentifier value.

In my installation, there’s no such tabs “result view”. Though there’s an Examples tab and it has three tabs arc, cURL, and php. Data in none of these tabs changes when I change data in Call Method tab.

Even though when following data is used in cURL still getting the same error

transactions=%5B%7B%22type%22%3A+%22title%22%2C+%22value%22%3A+%22Testing+AutoBug%22%7D%2C+%7B%22type%22%3A+%22description%22%2C+%22value%22%3A+%22This+is+a+test.%22%7D%2C+%7B%22type%22%3A+%22status%22%2C+%22value%22%3A+%22open%22%7D%2C+%7B%22type%22%3A+%22priority%22%2C+%22value%22%3A+%22triage%22%7D%2C+%7B%22type%22%3A+%22projects.set%22%2C+%22value%22%3A+%5B%22PHID-PROJ-lak2hnems3jq4srot3za%22%5D%7D%2C+%7B%22type%22%3A+%22comment%22%2C+%22value%22%3A+%22Test+comment%22%7D%5D&objectIdentifier=T1&output=json&api.token=api-hoqfusu2ndqck4jbhmbqgp4loojj

After you click Call Method, that’s the results view. That’s when you get more content in the tabs below.
image

Example is not getting updated when you click on “Call Method”, though I try to capture the request using Chrome developer tools.

curl 'http:/localhost:8080/api/maniphest.edit' --data 'params%5Btransactions%5D=%5B+++++++++%7B+++++++++++++%22type%22%3A+%22title%22%2C+++++++++++++%22value%22%3A+%22Testing+AutoBug%22+++++++++%7D%2C+++++++++%7B+++++++++++++%22type%22%3A+%22description%22%2C+++++++++++++%22value%22%3A+%22This+is+a+test.%22+++++++++%7D%2C+++++++++%7B+++++++++++++%22type%22%3A+%22status%22%2C+++++++++++++%22value%22%3A+%22open%22+++++++++%7D%2C+++++++++%7B+++++++++++++%22type%22%3A+%22priority%22%2C+++++++++++++%22value%22%3A+%22triage%22+++++++++%7D%2C+++++++++%7B+++++++++++++%22type%22%3A+%22projects.set%22%2C+++++++++++++%22value%22%3A+%5B%22PHID-PROJ-lak2hnems3jq4srot3za%22%5D+++++++++%7D%2C+++++++++%7B+++++++++++++%22type%22%3A+%22comment%22%2C+++++++++++++%22value%22%3A+%22Test+comment%22+++++++++%7D+++++%5D&params%5BobjectIdentifier%5D=%22T714%22&output=json&api.token=api-hoqfusu2ndqck4jbhmbqgp4loojj' 

This data throws another error

{"result":null,"error_code":"ERR-INVALID-SESSION","error_info":"Session key is not present."}

When I rename those form fields as
params%5transactions%5D => transactions
params%5BobjectIdentifier%5D = > objectIdentifier

Then it gives the same error

{"result":null,"error_code":"ERR-CONDUIT-CORE","error_info":"Parameter \"transactions\" is not a list of transactions."}

Even I looked at the code on Github could not find anything wrong with form data.

Never mind, figured it out data will be visible on successful form submission.