Skip to main content
POST
/
public
/
v1
/
import
/
refresh-data
Refresh Data in Google Sheets
curl --request POST \
  --url https://api.superjoin.ai/public/v1/import/refresh-data \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "spreadsheetId": "16OMa-CcvljWzsdursd7KjAdFhVoE0HehYB4CngyQZgj4",
  "sheetId": "649755416",
  "metadata": {
    "userEmailAddress": "support@superjoin.ai",
    "identifier": "refresh-2024-09-03-1234"
  }
}
'
import requests

url = "https://api.superjoin.ai/public/v1/import/refresh-data"

payload = {
"spreadsheetId": "16OMa-CcvljWzsdursd7KjAdFhVoE0HehYB4CngyQZgj4",
"sheetId": "649755416",
"metadata": {
"userEmailAddress": "support@superjoin.ai",
"identifier": "refresh-2024-09-03-1234"
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
spreadsheetId: '16OMa-CcvljWzsdursd7KjAdFhVoE0HehYB4CngyQZgj4',
sheetId: '649755416',
metadata: {
userEmailAddress: 'support@superjoin.ai',
identifier: 'refresh-2024-09-03-1234'
}
})
};

fetch('https://api.superjoin.ai/public/v1/import/refresh-data', 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.superjoin.ai/public/v1/import/refresh-data",
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([
'spreadsheetId' => '16OMa-CcvljWzsdursd7KjAdFhVoE0HehYB4CngyQZgj4',
'sheetId' => '649755416',
'metadata' => [
'userEmailAddress' => 'support@superjoin.ai',
'identifier' => 'refresh-2024-09-03-1234'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);

$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.superjoin.ai/public/v1/import/refresh-data"

payload := strings.NewReader("{\n \"spreadsheetId\": \"16OMa-CcvljWzsdursd7KjAdFhVoE0HehYB4CngyQZgj4\",\n \"sheetId\": \"649755416\",\n \"metadata\": {\n \"userEmailAddress\": \"support@superjoin.ai\",\n \"identifier\": \"refresh-2024-09-03-1234\"\n }\n}")

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

req.Header.Add("Authorization", "<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.superjoin.ai/public/v1/import/refresh-data")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"spreadsheetId\": \"16OMa-CcvljWzsdursd7KjAdFhVoE0HehYB4CngyQZgj4\",\n \"sheetId\": \"649755416\",\n \"metadata\": {\n \"userEmailAddress\": \"support@superjoin.ai\",\n \"identifier\": \"refresh-2024-09-03-1234\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.superjoin.ai/public/v1/import/refresh-data")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"spreadsheetId\": \"16OMa-CcvljWzsdursd7KjAdFhVoE0HehYB4CngyQZgj4\",\n \"sheetId\": \"649755416\",\n \"metadata\": {\n \"userEmailAddress\": \"support@superjoin.ai\",\n \"identifier\": \"refresh-2024-09-03-1234\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "message": "Data refreshed successfully."
}
{
"message": "Bad Request: Invalid inputs."
}
{
"message": "Forbidden: Invalid API Key."
}
{
"message": "Too many requests."
}
{
"message": "Internal server error."
}

Authorizations

Authorization
string
header
required

To access this endpoint, you need an API key. Please use the following format: Api-Key <API_KEY>.

If you don't have an API key, you can request one by reaching out to us at support@superjoin.ai.

In case you've misplaced your API key, you can request a new one; however, note that any previous keys will be deactivated.

Body

application/json
spreadsheetId
string
required

The ID of the spreadsheet you want to refresh.

Example:

"16OMa-CcvljWzsdursd7KjAdFhVoE0HehYB4CngyQZgj4"

sheetId
string
required

The ID of the specific sheet within the spreadsheet to refresh.

Example:

"649755416"

metadata
object

Optional metadata for the refresh operation.

Response

Successfully refreshed the data.

message
string
Example:

"Data refreshed successfully."