Skip to main content

Hi,

I am using webhooks (post as XML) and use an unflattened data payload like this:

  • item: CREmployee__toPrefRegion1Node__CRDataNode
  • value: 100

It renders as follows:

</CREmployee>
    <toPrefRegion1Node>
        <CRDataNode>100</CRDataNode>
    </toPrefRegion1Node>
</CREmployee>

But I want it to be rendered like this:

</CREmployee>
    <toPrefRegion1Node>
        <CRDataNode id="100"/>
    </toPrefRegion1Node>
</CREmployee>

So how can I move the datavalue (100) to the “id”-attribute of the XML element “CRDataNode”?

 

Thank you for replying.

Hi @raissa raissa 

Good question.

Can you link to the API documentation you are referencing to configure the Zap step?


Thank you Troy,

Yes sure! It’s mentioned here: https://help.zapier.com/hc/en-us/articles/8496083355661-How-to-Get-Started-with-Webhooks-by-Zapier#unflatten-nested-payloads-0-11

(In my case I use the XML-payload type instead of the JSON one)


@raissa raissa 

But what about the documentation you are referencing to know what XML structure to configure?


Hi @Troy Tessalone,

This is from the API interface of carerix.com (recruitment software supplier). You need a (developer) login to get access to the documentation but I’ve tested it with a piece of PHP-client code.

 


@raissa raissa

Can you post screenshots of the documentation for us to have context?

 

Otherwise we are limited in our ability to evaluate and advise.


@Troy Tessalone 

I couldn’t find the specific case, but here is a screenshot of how a certain employee is updated. Within the XML you see that the attribute “id” is used on the CRDataNode element.

Apart from this context, I just want to know (and how, if possible) whether I can setup attributes of XML elements in the payload.

 

 


@raissa raissa 

If you are using a PUT method request, have you tried using the exact provided XML structure as shown in the screenshot?


@Troy Tessalone 

Thank you for the hint. I’ve resolved it by changing the “event type” to custom event. That way I could build up the whole XML structure myself.

Thanks again!