How can I replace the path value with the parameter passed?

92 Views Asked by At

I am trying to pass path parameters in the path in Webhook task body of Palantir foundry in the below format.

{
    "calls": [
        {
            "type": "magritte-rest-call",
            "method": "GET",
            "parameters": {
                "empid": {{json emp}}
            },
           "path": "v1/data/employee/{empid}"
        }
    ]
}

I am getting a response in the format below.

"filename=v1_data_employee_null?empid=1234"

I am getting null in the path parameter v1_data_employee_null and value will assigned to query (?empid=1234) parameter.

I want path value to be replaced with the parameter passed (empid).

2

There are 2 best solutions below

1
On

You can use the notation described in the docs: @{createAccount.id}

      ...
          "recordId": "@{createAccount.id}"
        }
      }

In your case, it should work with: "path": "v1/data/employee/@{empid}"

0
On

Parameters have to be surrounded by {{ and }}. I am also not sure if you really need the json in the empid parameter?

{
    "calls": [
        {
            "type": "magritte-rest-call",
            "method": "GET",
            "parameters": {
                "empid": "{{empid}}"
            },
           "path": "v1/data/employee/{{empid}}"
        }
    ]
}