Numerology API - Kotlin

Numerology API with Kotlin 🟠

Integrate Numerology API into your Kotlin application.

Installation

This example needs no package: it uses the java.net.http client from JDK 11 and later, for Kotlin on the JVM. Android has no java.net.http; Android apps use the Android client listed on SDKs.

Example Code

import java.net.URI
import java.net.http.HttpClient
import java.net.http.HttpRequest
import java.net.http.HttpResponse

fun main() {
    val body = """
        {
          "name": "Asha Rao",
          "birthDate": "1990-06-15"
        }
    """.trimIndent()
    val request = HttpRequest.newBuilder()
        .uri(URI.create("https://api.vedika.io/v2/astrology/numerology/complete"))
        .header("Authorization", "Bearer YOUR_API_KEY")
        .header("Content-Type", "application/json")
        .POST(HttpRequest.BodyPublishers.ofString(body))
        .build()
    val response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString())
    println(response.statusCode())
    println(response.body())
}

Anything compiled into a shipped app can be extracted, including the API key. For consumer apps, call the Vedika API from your own backend and keep the key on the server.

Get Started Free

Try our sandbox API with no authentication required

Try Sandbox Read Docs