# Down a rabbit hole with http and Milestone

**URL:** <https://forum.inductiveautomation.com/t/down-a-rabbit-hole-with-http-and-milestone/111473>\
**Category:** Ignition\
**Created:** [October 15, 2025, 2:41pm UTC](https://forum.inductiveautomation.com/t/down-a-rabbit-hole-with-http-and-milestone/111473 "2025-10-15T14:41:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jordan\_Richardson](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@Jordan\_Richardson](https://forum.inductiveautomation.com/u/Jordan_Richardson)\
**Post date:** [October 15, 2025, 2:41pm UTC](https://forum.inductiveautomation.com/t/down-a-rabbit-hole-with-http-and-milestone/111473/1 "2025-10-15T14:41:07Z")

</div>

So, I have perused a many of topics about using **httpClient** and **post/get** but something is just not clicking for me yet. I am trying to integrate ignition with a trial version of Milestone x protects API gateway to dynamically create bookmarks. The **POST** method for bookmarking can be found here: [MIP VMS RESTful Bookmarks API reference](https://doc.developer.milestonesys.com/mipvmsapi/api/bookmarks-rest/v1/#tag/Bookmarks/operation/bookmarks_Post). However, before I get to that point, I have been going through the ‘getting started’ docs here: [MIP VMS RESTful Config API reference](https://doc.developer.milestonesys.com/mipvmsapi/api/config-rest/v1/#section/Introduction/Get-started). I know my installation is valid because I was able to perform step 6 via a system.net.httpget() and it returns the expected response. I get lost on the formatting for step 7 though. I guess what I’m asking is can someone help me ‘translate‘ the header/data from the link in to either system.net.httpPost() or even using the httpclient() and client.post() which I know is the preferred method.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 15, 2025, 2:54pm UTC](https://forum.inductiveautomation.com/t/down-a-rabbit-hole-with-http-and-milestone/111473/2 "2025-10-15T14:54:21Z")

</div>

According to Milestone, it's [XProtect VMS API Gateway](https://doc.milestonesys.com/latest/en-US/portal/htm/chapter-page-api-gateway.htm). (Note spelling, spacing and capitalisation. It matters to identify brand names in text and for search results.)

---

<div class="post-metadata">

**Author:** ![Jordan\_Richardson](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@Jordan\_Richardson](https://forum.inductiveautomation.com/u/Jordan_Richardson)\
**Post date:** [October 15, 2025, 3:27pm UTC](https://forum.inductiveautomation.com/t/down-a-rabbit-hole-with-http-and-milestone/111473/3 "2025-10-15T15:27:58Z")

</div>

I was able to get the api token with the following code(actual URL and creds omitted obviously). Now on to the bookmarking. I might run into the issue that Nick had in this post [Problems with Talk2M DMWeb API through system.net.httpClient and system.net.httpPost - Ignition - Inductive Automation Forum](https://forum.inductiveautomation.com/t/problems-with-talk2m-dmweb-api-through-system-net-httpclient-and-system-net-httppost/40441/7), but we’ll see shortly!

```python
import urllib
url = "http://somebogusurl.com/API/IDP/connect/token"
payload = urllib.urlencode({
    "grant_type": "password",
    "username": "User",
    "password": "password",
    "client_id": "GrantValidatorClient"
})

try:
    # Create an HttpClient instance (or use system.net.httpClient directly in Ignition 8.3+)
    # For older versions, consider creating a top-level instance for reuse.
	httpClient = system.net.httpClient() 
    
    #response = httpClient.post(url, data=payload) # Use data for form-urlencoded
    # Or for JSON payload:
	response=httpClient.post(url=url, headers={"Content-Type":"application/x-www-form-urlencoded"}, data=payload) 
	print response.json

except Exception as e:
	print(e)

```
