mutation ($documentId: ID!, $data: JSON, $actionId: ID!, $status: String) {
submitDocument(
id: $documentId
data: $data
actionId: $actionId
status: $status
)
}
curl 'https://subdomain.kualibuild.com/app/api/v0/graphql' -H 'Content-Type: application/json' -H 'Authorization: Bearer apikey' --data-binary '{"query":"mutation ($documentId: ID!, $data: JSON, $actionId: ID!, $status: String) { submitDocument( id: $documentId data: $data actionId: $actionId status: $status )}","variables":{
"documentId": "64029dab6f0562f58f91a206",
"data": {
"dORA8YYBmX": "English 450"
},
"actionId": "6402959d200606e80fe6f20d",
"status": "completed"
}}' --compressed
import fetch from 'node-fetch'
const subdomain = 'subdomain'
const apikey = 'apikey'
const query = `mutation ($documentId: ID!, $data: JSON, $actionId: ID!, $status: String) {
submitDocument(
id: $documentId
data: $data
actionId: $actionId
status: $status
)
}`
const variables = {
"documentId": "64029dab6f0562f58f91a206",
"data": {
"dORA8YYBmX": "English 450"
},
"actionId": "6402959d200606e80fe6f20d",
"status": "completed"
}
fetch(`https://${subdomain}.kualibuild.com/app/api/v0/graphql`, {
method:'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${apikey}`
},
body: JSON.stringify({query, variables})
})
.then(res => res.text())
.then(data => console.log(data))
.catch(err => console.log(err))
<?php
$subdomain = "subdomain";
$apikey = "apikey";
$url = "https://{$subdomain}.kualibuild.com/app/api/v0/graphql";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$headers = array(
"Content-Type: application/json",
"Authorization: Bearer {$apikey}",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$data= '{"query":"mutation ($documentId: ID!, $data: JSON, $actionId: ID!, $status: String) { submitDocument( id: $documentId data: $data actionId: $actionId status: $status )}","variables":{
"documentId": "64029dab6f0562f58f91a206",
"data": {
"dORA8YYBmX": "English 450"
},
"actionId": "6402959d200606e80fe6f20d",
"status": "completed"
}}';
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
//for debug only!
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);
require 'net/http'
require 'uri'
require 'json'
subdomain = "subdomain"
apikey = "apikey"
uri = URI.parse("https://#{subdomain}.kualibuild.com/app/api/v0/graphql")
request = Net::HTTP::Post.new(uri)
request.content_type = "application/json"
request["Authorization"] = "Bearer #{apikey}"
request.body = JSON.dump({
"query" => "mutation ($documentId: ID!, $data: JSON, $actionId: ID!, $status: String) {
submitDocument(
id: $documentId
data: $data
actionId: $actionId
status: $status
)
}",
"variables" => {
"documentId": "64029dab6f0562f58f91a206",
"data": {
"dORA8YYBmX": "English 450"
},
"actionId": "6402959d200606e80fe6f20d",
"status": "completed"
}
})
req_options = {
use_ssl: uri.scheme == "https",
}
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(request)
end
puts response.code
puts response.body
import java.io.*;
import java.util.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.Charset;
public class exampleCreate {
public static void main(String[] args) throws IOException {
String subdomain = "subdomain";
String apikey = "apikey";
URL url = new URL("https://" + subdomain + ".kualibuild.com/app/api/v0/graphql");
HttpURLConnection http = (HttpURLConnection)url.openConnection();
http.setRequestMethod("POST");
http.setDoOutput(true);
http.setRequestProperty("Content-Type", "application/json");
http.setRequestProperty("Origin", "https://" + subdomain + ".kualibuild.com");
http.setRequestProperty("Authorization", "Bearer " + apikey);
String data = "{\"query\":\"mutation ($documentId: ID!, $data: JSON, $actionId: ID!, $status: String) { submitDocument( id: $documentId data: $data actionId: $actionId status: $status )}\",\"variables\":{\"documentId\":\"64029dab6f0562f58f91a206\",\"data\":{\"dORA8YYBmX\":\"English450\"},\"actionId\":\"6402959d200606e80fe6f20d\",\"status\":\"completed\"}}";
byte[] out = data.getBytes(Charset.forName("UTF-8"));
OutputStream stream = http.getOutputStream();
stream.write(out);
System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
BufferedReader in = new BufferedReader(new InputStreamReader(http.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
//print in String
System.out.println(response.toString());
http.disconnect();
}
}