# Ignition Maker Edition / FordConnect API Issues

**URL:** <https://forum.inductiveautomation.com/t/ignition-maker-edition-fordconnect-api-issues/97418>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [October 17, 2024, 7:10pm UTC](https://forum.inductiveautomation.com/t/ignition-maker-edition-fordconnect-api-issues/97418 "2024-10-17T19:10:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicholas\_Houston](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nicholas_houston/32/68700_2.png) [@Nicholas\_Houston](https://forum.inductiveautomation.com/u/Nicholas_Houston)\
**Post date:** [October 17, 2024, 7:10pm UTC](https://forum.inductiveautomation.com/t/ignition-maker-edition-fordconnect-api-issues/97418/1 "2024-10-17T19:10:13Z")

</div>

Hello everyone,

I am attempting to get connected to the Ford API in order to integrate my truck into my home automation dashboard I am creating for my home.

I went through the documentation and got everything working with Postman, however when I try to use ignition scripts to hit the API, but for some reason will not work. I _believe_ I have everything formatted the same as postman, but it still is not working. Below are some screenshots of my script and then screenshots of Postman with a valid response. I will also include pictures of the headers that Postman is sending to the URL as well as body context.

Refresh Token API Call "Valid response / not showing the token for security reasons" (Postman)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f7c563a8c8c51b77e3d75356f9a0de74af708b5c.png)

Headers (same API Call)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/5/15296a051fb1b01c6139ca12344ff2297aeab5a1.png)

Body (also same API Call)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/8/68be5531173e954ffab03441d6ef4dd48d272cac.png)

Now on the scripting side I have the refresh\_token populated in a tag as well as client\_secret and client\_id (here is a picture of my script with the result)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/6/e686659d0fce4df479102f91a707f75c632c84c3.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/2/027b40867368eef893bbe95aa5eb7a1c1d3f4d15.png)

---

<div class="post-metadata">

**Author:** ![Nicholas\_Houston](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nicholas_houston/32/68700_2.png) [@Nicholas\_Houston](https://forum.inductiveautomation.com/u/Nicholas_Houston)\
**Post date:** [October 17, 2024, 10:00pm UTC](https://forum.inductiveautomation.com/t/ignition-maker-edition-fordconnect-api-issues/97418/2 "2024-10-17T22:00:57Z")

</div>

Update: I got part of it working, however I noticed in a different Ignition post on the forum that there is no support for multipart/form-data in ignition at this time. Is that still true? The post was from 2022.

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [October 17, 2024, 10:28pm UTC](https://forum.inductiveautomation.com/t/ignition-maker-edition-fordconnect-api-issues/97418/3 "2024-10-17T22:28:24Z")

</div>

I have used the `multipart/form-data` content type before - the only caveat is you have to manually create the boundary and format the fields within the form. Here is a code snippet I pulled from a previous project:

```python
def jsonToMultipartFormData(json): 
	""" 
	Translates the application/json content type to 
	the multipart/form-data type for easier processing
	""" 
	import mimetypes 
	import os  
	boundary = "----WebKitFormBoundary7MA4YWxkTrZuOgW" 
	CRLF = "\r\n" 
	body = "" 

	for key, value in json.items(): 
		body += '--' + boundary + CRLF  
		body += 'Content-Disposition: form-data; name="{}"'.format(key) + CRLF  
		body += CRLF  
		body += str(value) + CRLF 
	body += '--' + boundary + '--' + CRLF 
	content_type = 'multipart/form-data; boundary={}'.format(boundary) 
	return { "content_type": content_type, "body": body }

```

Just to warn you, the code formatting might be messed up because I had to send it to myself through Teams, but that should give you an idea of what you can do to use that MIME type.

I wrote this code what seems like years ago, so I don't remember the exact usage, but I believe what gets returned from this function would end up as your `httpClient`'s `body` (Postman terminology).

---

<div class="post-metadata">

**Author:** ![Nicholas\_Houston](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nicholas_houston/32/68700_2.png) [@Nicholas\_Houston](https://forum.inductiveautomation.com/u/Nicholas_Houston)\
**Post date:** [October 17, 2024, 11:26pm UTC](https://forum.inductiveautomation.com/t/ignition-maker-edition-fordconnect-api-issues/97418/4 "2024-10-17T23:26:16Z")

</div>

I'm posting a screenshot of

1. My script that I'm attempting to use in order to get a response from an API.
2. The way your script formatted it as multipart/form-data
3. The response from the API  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/3/b3922e99443b73b80c98fad3936f9155883ebfa5.png)

I have the grant\_type parameter in the payload so I'm assuming its not formatted as form-data correctly?
