Skip to main content
POST
/
app-integration
Create App Integration
curl --request POST \
  --url https://apiweb.mile.app/api/v3/app-integration \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'azureAuthUrl=<string>' \
  --form azureCert='@example-file' \
  --form 'integrationType=<string>'
import requests

url = "https://apiweb.mile.app/api/v3/app-integration"

files = { "azureCert": ("example-file", open("example-file", "rb")) }
payload = {
"azureAuthUrl": "<string>",
"integrationType": "<string>"
}
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.text)
const form = new FormData();
form.append('azureAuthUrl', '<string>');
form.append('azureCert', '<string>');
form.append('integrationType', '<string>');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

fetch('https://apiweb.mile.app/api/v3/app-integration', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/app-integration",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"azureAuthUrl\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"azureCert\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"integrationType\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://apiweb.mile.app/api/v3/app-integration"

payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"azureAuthUrl\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"azureCert\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"integrationType\"\r\n\r\n<string>\r\n-----011000010111000001101001--")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://apiweb.mile.app/api/v3/app-integration")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"azureAuthUrl\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"azureCert\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"integrationType\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();
require 'uri'
require 'net/http'

url = URI("https://apiweb.mile.app/api/v3/app-integration")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"azureAuthUrl\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"azureCert\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"integrationType\"\r\n\r\n<string>\r\n-----011000010111000001101001--"

response = http.request(request)
puts response.read_body
{
  "status": true,
  "code": 201,
  "message": "Integration has been added successfully.",
  "data": {
    "integrationType": "azure",
    "azureAuthUrl": "https://login.microsoftonline.com/XXX-5f2b-XXX-90a0-XXX/saml2",
    "azureCert": "https://apistorage.mile.app/v3-public-dev/dev/66791b2bfabcde/2024/12/28/app.cer",
    "organizationId": "66791b2bf001a712b77b3622",
    "updatedTime": "2024-12-29T13:01:01.924000Z",
    "createdTime": "2024-12-29T13:01:01.924000Z",
    "_id": "6771480dc13375875909b693"
  }
}
{
"status": false,
"message": "Bad request - invalid parameters provided."
}
{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Body

multipart/form-data
azureAuthUrl
string
required

this parameter for auth url provided by azure

azureCert
file
required

this parameter for certificate file provided by azure

integrationType
string

this parameter for integration type, Currently available for azure

Response

Success

status
string

Status of response.

data
object

Detail object of created App Integration.