FCF: Mapping Input to Form instead of JSON in body

I am trying to create a connector to the Marketo Assets API to create a Static List.

 

I need to POST a call to the endpoint and pass the form parameters folder and name.

 

My operation definition is as follows:

var createStaticList = this.Operations.Create<StaticList>("/rest/asset/v1/staticLists.json")
.ToHeader("Authorization", AccessToken)
.ToHeader("Content-Type", "application/x-www-form-urlencoded")
.FromInputToForm("name")
.FromInputToForm("folder");

However, when I run the map the FCF creates a call with the StaticList entity encoded in JSON in the body:

 

POST https://x.mktorest.com/rest/asset/v1/staticLists.json HTTP/1.1
Authorization: Bearer x
Accept: application/json
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Host: 908-skz-106.mktorest.com
Content-Length: 110
Expect: 100-continue
 
{"id":0,"name":"test creation from Scribe","createdAt":null,"updatedAt":null,"folder":null,"computedUrl":null}

Does anyone know what I am doing wrong?

 

Thanks,

 

Jan van Werkhoven

(3) Answers

Login