Android -CosmosDB : AzureData.getDocument() API call fails to return document

Author: Chandra

I am trying to integrate Cosmos DB in the android app using AzureData client lib

I've successfully configured AzureData.Configure() and also created a database. However, I am unable to access the document from the existing collection using the API AzureData.getDocument().

This API is returning the error

{
  "code":"NotFound",
  "message":"Entity with the specified id does not exist in the system"
}

Could someone please help me with suggestions in this regard

The psuedo code is given below:

AzureData.configure(
            context,
            appData.appConfig.azureCosmosDB.DatabaseId,
            appData.appConfig.azureCosmosDB.PrimaryKey,
            PermissionMode.All /* or PermissionMode.Read */
        )

var isconfigured =  AzureData.isConfigured // true


 AzureData.getDocument(
                    "mydocId"
                    "partitionKey", 
                   " collectionId",
                    "databaseId",
                    CosmosDocument::class.java
                )
                {
                    var document = it.resource // return null
                    var error = it.error // returns error 
                }

Originally Sourced from: https://stackoverflow.com/questions/57898817/android-cosmosdb-azuredata-getdocument-api-call-fails-to-return-document