Quick Start¶
Get up and running with Totis in 5 minutes.
Installation¶
Using cURL¶
All examples in this documentation use cURL. Make sure you have it installed:
Using SDKs¶
SDKs are available for popular languages:
Your First API Call¶
1. Get Your Token¶
export TOKEN=$(curl -s -X POST https://api.usetotis.com/api/v1/login/oauth/access_token \
-d "grant_type=password" \
-d "[email protected]" \
-d "password=your-password" | jq -r '.access_token')
2. Get Your User Info¶
3. List Your Workspaces¶
Complete Workflow Example¶
Here's a complete example of uploading a build:
#!/bin/bash
# Configuration
API_URL="https://api.usetotis.com/api/v1"
WORKSPACE="my-workspace"
PROJECT="my-app"
FILE_PATH="./app.apk"
# 1. Authenticate
TOKEN=$(curl -s -X POST "$API_URL/login/oauth/access_token" \
-d "grant_type=password" \
-d "username=$EMAIL" \
-d "password=$PASSWORD" | jq -r '.access_token')
# 2. Create a build
BUILD_ID=$(curl -s -X POST "$API_URL/workspace/$WORKSPACE/project/$PROJECT/build" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0.0",
"buildNumber": "100",
"platform": "ANDROID",
"buildType": "RELEASE"
}' | jq -r '.buildId')
echo "Created build: $BUILD_ID"
# 3. Get signed upload URL
SIGN_RESPONSE=$(curl -s -X POST "$API_URL/workspace/$WORKSPACE/project/$PROJECT/build/$BUILD_ID/sign" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"filename\": \"$(basename $FILE_PATH)\"}")
UPLOAD_URL=$(echo $SIGN_RESPONSE | jq -r '.signedUrl')
SIGNED_TOKEN=$(echo $SIGN_RESPONSE | jq -r '.signedToken')
# 4. Upload file to S3
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: application/octet-stream" \
--data-binary "@$FILE_PATH"
# 5. Confirm upload
curl -X POST "$API_URL/workspace/$WORKSPACE/project/$PROJECT/build/$BUILD_ID/upload" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "\"$SIGNED_TOKEN\""
echo "Build uploaded successfully!"
Environment Variables¶
For convenience, set these environment variables:
export TOTIS_API_URL="https://api.usetotis.com/api/v1"
export TOTIS_EMAIL="[email protected]"
export TOTIS_PASSWORD="your-password"