import org.json.JSONObject;
import suprsend.Suprsend;
import suprsend.SuprsendAPIException;
public class Tenants {
public static void main(String[] args) throws Exception {
updateTenant();
}
private static Subscriber updateTenant() throws SuprsendException {
Suprsend suprsendClient = new Suprsend("_workspace_key_", "_workspace_secret_");
// Create Tenant data JSON
String tenantId = "br-01";
JSONObject payload = new JSONObject()
.put("tenant_name", "awesome tenant")
.put("logo", "https://ik.imagekit.io/l0quatz6utm/suprsend/staging/media/suprsend-only-logo_c8aa27faef118418e8c5bd7b31a1cafc74e09200.png")
.put("primary_color", "#ff0000")
.put("secondary_color", "#0000ff")
.put("tertiary_color", "#00ffff")
.put("social_links", new JSONObject()
.put("website", "https://www.company.com")
.put("youtube", "https://www.company.com/youtube")
.put("twitter", "https://www.company.com/twitter")
.put("facebook", "")
.put("linkedin", "")
.put("instagram", "")
.put("discord", "")
.put("medium", "")
.put("telegram", "")
)
.put("properties", new JSONObject()
.put("address", "my company address")
)
;
try {
JSONObject res = suprClient.tenants.upsert(tenantId, payload);
System.out.println(res);
} catch (SuprsendException e) {
System.out.println(e);
}
}
}