cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Multipart request using custom action?

ryan-avent
Deputy Chef II
Deputy Chef II

Im looking at the Dynamics CRM connector and I have hit a situation where I need to specify a multipart request (inorder to use there batch api) however the standard connector does not seem to support this action. i do see that custom action is supported however this body is always Json...

Do I need to make my own connector to handle this action or is there something I'm just overlooking e.g. a way do define a multipart request as Json.

example Microsoft batch 

 

POST [Organization Uri]/api/data/v9.2/$batch HTTP/1.1
OData-MaxVersion: 4.0
OData-Version: 4.0
If-None-Match: null
Accept: application/json
Content-Type: multipart/mixed; boundary="batch_80dd1615-2a10-428a-bb6f-0e559792721f"

--batch_80dd1615-2a10-428a-bb6f-0e559792721f
Content-Type: application/http
Content-Transfer-Encoding: binary

POST /api/data/v9.2/tasks HTTP/1.1
Content-Type: application/json; type=entry

{
  "subject": "Task 1 in batch",
  "regardingobjectid_account_task@odata.bind": "accounts(00000000-0000-0000-0000-000000000001)"
}
--batch_80dd1615-2a10-428a-bb6f-0e559792721f
Content-Type: application/http
Content-Transfer-Encoding: binary

POST /api/data/v9.2/tasks HTTP/1.1
Content-Type: application/json; type=entry

{
  "subject": "Task 2 in batch",
  "regardingobjectid_account_task@odata.bind": "accounts(00000000-0000-0000-0000-000000000001)"
}
--batch_80dd1615-2a10-428a-bb6f-0e559792721f
Content-Type: application/http
Content-Transfer-Encoding: binary

POST /api/data/v9.2/tasks HTTP/1.1
Content-Type: application/json; type=entry

{
  "subject": "Task 3 in batch",
  "regardingobjectid_account_task@odata.bind": "accounts(00000000-0000-0000-0000-000000000001)"
}
--batch_80dd1615-2a10-428a-bb6f-0e559792721f
Content-Type: application/http
Content-Transfer-Encoding: binary

GET /api/data/v9.2/accounts(00000000-0000-0000-0000-000000000001)/Account_Tasks?$select=subject HTTP/1.1


--batch_80dd1615-2a10-428a-bb6f-0e559792721f--

 

 

2 ACCEPTED SOLUTIONS

GrailAutomation
Deputy Chef III
Deputy Chef III

A custom connector would definitely get the job done... but would it work to use multiple custom actions in a row? Or perhaps the Ruby/Python connector (I haven't used those much).

View solution in original post

marlon-muela
Workato employee
Workato employee

Hi @ryan-avent ,

On the custom action in Microsoft Dynamics, have you tried using a Raw response and adding the Content-Type on the Request Header? I can't see any similar use case, but I have tried this using a multipart form for GDrive, and it worked.

marlonmuela_0-1698677384956.png

If it doesn't work; you can try using HTTP or SDK connector.

View solution in original post

2 REPLIES 2

GrailAutomation
Deputy Chef III
Deputy Chef III

A custom connector would definitely get the job done... but would it work to use multiple custom actions in a row? Or perhaps the Ruby/Python connector (I haven't used those much).

marlon-muela
Workato employee
Workato employee

Hi @ryan-avent ,

On the custom action in Microsoft Dynamics, have you tried using a Raw response and adding the Content-Type on the Request Header? I can't see any similar use case, but I have tried this using a multipart form for GDrive, and it worked.

marlonmuela_0-1698677384956.png

If it doesn't work; you can try using HTTP or SDK connector.