Im using Unity3D engine along with StorageServices. But encountering following error on execution...
Exception : com.shephertz.app42.paas.sdk.csharp.App42BadParameterException: {"httpErrorCode":400, "appErrorCode":1400, "message":"Bad Request", "details":"The Request parameters are invalid"}
UnityEngine.Debug:Log(Object)
com.shephertz.app42.paas.sdk.csharp.App42Log:Console(String)
UnityCallBack:OnException(Exception) (at Assets/UnityCallBack.cs:23)
com.shephertz.app42.paas.sdk.csharp.connection.<execute>d__6:MoveNext()
com.shephertz.app42.paas.sdk.csharp.connection.<WaitForRequest>d__3:MoveNext()
Scripts:
using UnityEngine;
using System.Collections;
using com.shephertz.app42.paas.sdk.csharp;
using com.shephertz.app42.paas.sdk.csharp.storage;
using System.Collections.Generic;
using System;
public class test :MonoBehaviour{
StorageService storageService;
// Use this for initialization
void Start () {
App42API.Initialize("API key","secret key");
storageService = App42API.BuildStorageService();
string dbName = "Test";
string collectionName = "Test_Collection";
string json = "Test!!";
App42Log.SetDebug(true); //Print output in your editor console
storageService.InsertJSONDocument(dbName, collectionName, json, new UnityCallBack());
}
}
public class UnityCallBack : App42CallBack
{
public void OnSuccess(object response)
{
Storage storage = (Storage) response;
IList<Storage.JSONDocument> jsonDocList = storage.GetJsonDocList();
for(int i=0;i <jsonDocList.Count;i++)
{
App42Log.Console("objectId is " + jsonDocList[i].GetDocId());
}
}
public void OnException(Exception e)
{
App42Log.Console("Exception : " + e);
}
}
Any solution?