API Proxy Set Up

Set Up Steps for the API Proxy

We’ve made using the MIG VAN API Proxy as easy as possible – all you have to do is swap the host name and request header in your VAN API requests.

As a complete 1:1, the MIG VAN API Proxy supports all VAN API routes and responses. If the specific endpoint you’re sending data to in VAN already has webhook notifications configured, you will continue to receive those notifications from VAN.

  1. Swap Host Name URL
    1. Change your hostname endpoint URL from https://api.securevan.com to the
      API Proxy endpoint: https://vanapi.movementinfrastructure.org
      1. Example MIG endpoint structure: https://vanapi.movementinfrastructure.org/v4/apiKeyProfiles
  2. Set the request header to the X-MIGVID to the value provided during your onboarding
    1. Example request header: X-MIGVID: mig.c8f2edd4-9a9b-415c-beb2-354fae09747a
    2. If you need access to this header at any point, please reach out to us at [email protected].
  3. Follow the same steps as your usual VAN API request paths

For further support on the details of VAN API authentication steps, refer to the VAN Authentication documentation.

For questions or assistance getting set up please contact MIG Support at [email protected]

Examples

Updated API URL

Here is an example of what your updated API URL should look like:

   VAN_API_APP_NAME='example.000.001'
   VAN_API_KEY='1173483d-77d6-4c72-8159-a135a5829aff'
   VAN_DATABASE_MODE=1
   API_URL='https://vanapi.movementinfrastructure.org'
   MIGVID='mig.c8f2edd4-9a9b-415c-beb2-354fae09747a'

Request header X-MIGVID Example

Here is an example of an updated request header X-MIGVID (provided to you as part of your onboarding):

 #The same call as above, with the additional X-MIGVID header
   curl -X POST \
    -u "$VAN_API_APP_NAME:$VAN_API_KEY|$VAN_DATABASE_MODE" \
    -H 'Content-Type: application/json' \
    -H "X-MIGVID: $MIGVID" \
    -d '{"message":"Hello!"}' \
    $API_URL/v4/echoes

Errors and Troubleshooting

The MIG API v1 emits two types of errors: proxied VAN errors, and MIG API Proxy errors. Errors from MIG code follow the proposed problem details standard, with an additional “source” property to help identify the component.

VAN errors follow the scheme outlined in the VAN API error documentation. MIG performs light validation on request properties to ensure we only send requests that can succeed. If the Proxy is unable to deliver a request to the VAN API you will receive an error message. You can find examples of MIG error messages below.

Proxy-based errors will have source:proxy to help distinguish between proxy-based errors and VAN-based errors.

Error Examples

Invalid Authorization Header

{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.2",
"title":" "Missing Authorization Header",
"status": 401,
"detail": "Requests to this API must have a valid Authorization header",
"errors": {},
"source": "proxy"
}

Invalid Header

{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "Invalid X-MIGVID Header",
"status": 400,
"detail": "Requests to this API must have a valid X-MIGVID header",
"errors": {},
"source": "proxy"
}