Page 1 of 1

calling appery.io db rest services from .NET

Posted: Thu May 29, 2014 9:24 pm
by scott smiley

Is there an example on how to call the appery.io database services from .NET?

We are trying to preload values into appery database collection from our internal SQL server. We are calling a collection we created and allowed appery to generate the db services. Now we would like to call the create service so we can add records. We don't want the mobile app adding records...only modifying them.

We are calling this url
https://api.appery.io/rest/1/db/colle...

with this JSON
{
"headers": {
"X-Appery-Database-Id": "[this value is the correct db id]",
"Content-Type": "application/json"
},
"body": {
"CarFitNumber": "9876",
"Fullname": "Andrew Hubert TEST"

}
}

and the request returns this error

Message from JSON response JBoss Web/7.0.17.Final - Error report<!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}-- HTTP Status 400 - type Status report

message

description The request sent by the client was syntactically incorrect ().

JBoss Web/7.0.17.Final


calling appery.io db rest services from .NET

Posted: Fri May 30, 2014 12:16 am
by Yurii Orishchuk

Hi Scott.

Unfortunatly we can not to write code in .net platform.

Please take a look at here: http://devcenter.appery.io/documentat...

To create new item in your "some" collection you should use following curl:

precode

curl -X POST
-H "X-Appery-Database-Id: 526fdbd8e4b07c3286b537f1"
-H "Content-Type: application/json"
-d "{'taskName':'Buy milk', 'priority':'High'}"
https:&#47;&#47;api&#46;appery&#46;io/rest/1/db/collections/some

/code/pre

Lets get into details for this command.

  1. Method name "POST".

    2 Url where you need to send request is: https://api.appery.io/rest/1/db/colle...

    3 Request has two headers "X-Appery-Database-Id" and "Content-Type". So you should pass this headers into request.

    4 Request payload you should have JSON string with object you need to add. For example:

    {"name":"newOneName"}

    That's all.

    Also please take a look on request screen shot(may be it can help). http://prntscr.com/3nvenc/direct

    Regards.