Record an in-app store sheet tap and get what keeps the deep link
Record an in-app store sheet tap and get what keeps the deep link (new).
method
POST
host
strait.
version
/v1
resource
/
POST /v1/store-sheet
Auth: publishable key as publishableKey in the JSON body. Safe in apps and websites.
Request
New. Called by the SDKs (Strait.openStoreSheet) just before an app shows the app store inside itself: Google Play inline install on Android, SKOverlay / SKStoreProductViewController on iPhone. Records a tap with sent_to 'store_sheet' (not billed while the store sheet is new). Android gets the Play Install Referrer string (strait_link + strait_click, matched exactly by /v1/referrer); iPhone gets the App Store id, the link's campaign as the ct token and, with Paste handoff on, a one-time handoff link. This works inside your own app only; a link tapped inside another company's app cannot open a store sheet there.
Body (JSON)
publishableKeyrequired stringurlrequired string- A short link of the key's workspace
deviceClass"phone" | "tablet"- What the app runs on (iPad = tablet); phone when not sent
platformrequired "android" | "ios"
Response
- 200 ok:true with the store details, or ok:false with reason (not_found, disabled, expired, not_live, password_protected)
- 400 Bad url or platform
- 401 Missing or invalid publishable key
curl -X POST https://strait.link/v1/store-sheet \
-H "Content-Type: application/json" \
-d '{
"publishableKey": "st_pub_live_…",
"url": "https://hilltop.strait.link/summer",
"platform": "android"
}'const res = await fetch('https://strait.link/v1/store-sheet', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"publishableKey": "st_pub_live_…",
"url": "https://hilltop.strait.link/summer",
"platform": "android"
}),
});
const data = await res.json();
console.log(res.status, data);import requests
res = requests.post(
"https://strait.link/v1/store-sheet",
json={
"publishableKey": "st_pub_live_…",
"url": "https://hilltop.strait.link/summer",
"platform": "android",
},
)
print(res.status_code, res.json())<?php
// Plain PHP with ext-curl, no packages. In Laravel, Http::post($url, $body) sends the same request.
$ch = curl_init('https://strait.link/v1/store-sheet');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'publishableKey' => 'st_pub_live_…',
'url' => 'https://hilltop.strait.link/summer',
'platform' => 'android',
], JSON_THROW_ON_ERROR),
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL;
print_r(json_decode($response, true));import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
// Java 17+, java.net.http only (no dependencies).
public class Main {
public static void main(String[] args) throws Exception {
String body = """
{
"publishableKey": "st_pub_live_…",
"url": "https://hilltop.strait.link/summer",
"platform": "android"
}
""";
HttpRequest request = HttpRequest.newBuilder(URI.create("https://strait.link/v1/store-sheet"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> res = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());
}
}package main
import (
"fmt"
"io"
"log"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"publishableKey": "st_pub_live_…",
"url": "https://hilltop.strait.link/summer",
"platform": "android"
}`)
req, err := http.NewRequest(http.MethodPost, "https://strait.link/v1/store-sheet", body)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(res.StatusCode, string(data))
}The response, printed
{
"ok": true,
"beta": true,
"clickId": "9a1c7e52-4b3d-4f8e-a6d1-0c2b5e7f9a34",
"linkId": "lnk_5f0c2a8e-3b1d-4f6a-9c7e-2d8b1a0e4f63",
"android": {
"package": "shoes.hilltop.app",
"referrer": "strait_link=lnk_5f0c2a8e-3b1d-4f6a-9c7e-2d8b1a0e4f63&strait_click=9a1c7e52-4b3d-4f8e-a6d1-0c2b5e7f9a34"
}
}