Generate Survey Link
curl --request POST \
--url https://api.publisher.miratsquanto.com/api/v1/publisher/surveys/{surveyNumber}/link \
--header 'Content-Type: application/json' \
--header 'publisher-authentication-key: <api-key>' \
--data '
{
"authorizationKey": "DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU"
}
'import requests
url = "https://api.publisher.miratsquanto.com/api/v1/publisher/surveys/{surveyNumber}/link"
payload = { "authorizationKey": "DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU" }
headers = {
"publisher-authentication-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'publisher-authentication-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({authorizationKey: 'DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU'})
};
fetch('https://api.publisher.miratsquanto.com/api/v1/publisher/surveys/{surveyNumber}/link', 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://api.publisher.miratsquanto.com/api/v1/publisher/surveys/{surveyNumber}/link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'authorizationKey' => 'DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"publisher-authentication-key: <api-key>"
],
]);
$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://api.publisher.miratsquanto.com/api/v1/publisher/surveys/{surveyNumber}/link"
payload := strings.NewReader("{\n \"authorizationKey\": \"DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("publisher-authentication-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.publisher.miratsquanto.com/api/v1/publisher/surveys/{surveyNumber}/link")
.header("publisher-authentication-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"authorizationKey\": \"DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.publisher.miratsquanto.com/api/v1/publisher/surveys/{surveyNumber}/link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["publisher-authentication-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"authorizationKey\": \"DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU\"\n}"
response = http.request(request)
puts response.read_body{
"testLink": "https://api.publisher.miratsquanto.com/start?pid=someencryptedid&org=someencryptedid&sId=someencryptedid&supId=someencryptedid&orgId=someencryptedid&sn=100000001&t=1&r=xxxxx",
"liveLink": "https://api.publisher.miratsquanto.com/start?pid=someencryptedid&org=someencryptedid&sId=someencryptedid&supId=someencryptedid&orgId=someencryptedid&sn=100000001&t=0&r=xxxxx"
}{
"message": "internal server error",
"code": 500,
"success": false
}Endpoint Examples
Generate Survey Link
Generate a test and live link for a specific survey.
POST
/
surveys
/
{surveyNumber}
/
link
Generate Survey Link
curl --request POST \
--url https://api.publisher.miratsquanto.com/api/v1/publisher/surveys/{surveyNumber}/link \
--header 'Content-Type: application/json' \
--header 'publisher-authentication-key: <api-key>' \
--data '
{
"authorizationKey": "DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU"
}
'import requests
url = "https://api.publisher.miratsquanto.com/api/v1/publisher/surveys/{surveyNumber}/link"
payload = { "authorizationKey": "DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU" }
headers = {
"publisher-authentication-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'publisher-authentication-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({authorizationKey: 'DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU'})
};
fetch('https://api.publisher.miratsquanto.com/api/v1/publisher/surveys/{surveyNumber}/link', 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://api.publisher.miratsquanto.com/api/v1/publisher/surveys/{surveyNumber}/link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'authorizationKey' => 'DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"publisher-authentication-key: <api-key>"
],
]);
$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://api.publisher.miratsquanto.com/api/v1/publisher/surveys/{surveyNumber}/link"
payload := strings.NewReader("{\n \"authorizationKey\": \"DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("publisher-authentication-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.publisher.miratsquanto.com/api/v1/publisher/surveys/{surveyNumber}/link")
.header("publisher-authentication-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"authorizationKey\": \"DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.publisher.miratsquanto.com/api/v1/publisher/surveys/{surveyNumber}/link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["publisher-authentication-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"authorizationKey\": \"DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU\"\n}"
response = http.request(request)
puts response.read_body{
"testLink": "https://api.publisher.miratsquanto.com/start?pid=someencryptedid&org=someencryptedid&sId=someencryptedid&supId=someencryptedid&orgId=someencryptedid&sn=100000001&t=1&r=xxxxx",
"liveLink": "https://api.publisher.miratsquanto.com/start?pid=someencryptedid&org=someencryptedid&sId=someencryptedid&supId=someencryptedid&orgId=someencryptedid&sn=100000001&t=0&r=xxxxx"
}{
"message": "internal server error",
"code": 500,
"success": false
}Generate Survey Link
Generate a link for a specific survey.Endpoint
POST /surveys/{surveyNumber}/link
Headers
{
"publisher-authentication-key": "your_project_secret_key"
}
Note: Thepublisher-authentication-keyheader corresponds to your Secret Key. TheauthorizationKeyin the request body corresponds to your Web API Key.
Request Body
{
"authorizationKey": "DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU"
}
Response
{
"testLink": "https://api.publisher.miratsquanto.com/start?pid=someencryptedid&org=someencryptedid&sId=someencryptedid&supId=someencryptedid&orgId=someencryptedid&sn=100000001&t=1&r=xxxxx",
"liveLink": "https://api.publisher.miratsquanto.com/start?pid=someencryptedid&org=someencryptedid&sId=someencryptedid&supId=someencryptedid&orgId=someencryptedid&sn=100000001&t=0&r=xxxxx"
}
Error Response
{
"message": "internal server error",
"code": 500,
"success": false
}
Authorizations
Send your Secret Key using the publisher-authentication-key header. This header is required for every request.
Path Parameters
Example:
17633744316785364
Body
application/json
Payload for endpoints that only require the Web API Key in the request body.
Web API Key obtained from the Mirats Publisher Platform.
Example:
"DqcInvhIFAl5WtUNwihFUIgUH77EL2hTNRU"
Response
Successful response with generated links
Example:
"https://api.publisher.miratsquanto.com/start?pid=someencryptedid&org=someencryptedid&sId=someencryptedid&supId=someencryptedid&orgId=someencryptedid&sn=100000001&t=1&r=xxxxx"
Example:
"https://api.publisher.miratsquanto.com/start?pid=someencryptedid&org=someencryptedid&sId=someencryptedid&supId=someencryptedid&orgId=someencryptedid&sn=100000001&t=0&r=xxxxx"

