Switch API is the primary endpoint of data sevices and Switch DB's platform. You can do adding, editing, deleting or listing data works to your database with query operations by using this low-level API based on HTTP.
This C# SDK is automatically generated by the Swagger Codegen project:
- API version: 1.2.1
- SDK version: 1.0.0
- Build date: 2017-04-18T15:40:07.735Z
- Build package: io.swagger.codegen.languages.CsharpDotNet2ClientCodegen
- .NET 2.0
- Mono compiler
- Newtonsoft.Json.7.0.1
- RestSharp.Net2.1.1.11
Note: NuGet is downloaded by the mono compilation script and packages are installed with it. No dependency DLLs are bundled with this generator
Run the following command to generate the DLL
- [Mac/Linux]
/bin/sh compile-mono.sh - [Windows] TODO
Then include the DLL (under the bin folder) in the C# project, and use the namespaces:
using IO.Swagger.IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.IO.Swagger.Model;using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class Example
{
public void main()
{
var apiInstance = new AuthorizationApi();
var aPIKey = aPIKey_example; // string | Your Switch API Key.
var signature = signature_example; // string | Signature parameter is generated as md5(APISecret + ExpireTimestamp) format.
var expire = 789; // long? | Expire parameter, token's expire date and time information must be proper to ISO 8601 standarts and Unix Time format with msec information.
try
{
// Generate Access Token
string result = apiInstance.TokenGet(aPIKey, signature, expire);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling AuthorizationApi.TokenGet: " + e.Message );
}
}
}
}All URIs are relative to http://tr02.switchapi.com/
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AuthorizationApi | TokenGet | GET /Token | Generate Access Token |
| DBOperationsApi | AddPost | POST /Add | Add is used for adding a data object to the list created at Switch DB. |
| DBOperationsApi | ListPost | POST /List | It's used for listing a data added before. |
| DBOperationsApi | SetDelete | DELETE /Set | It's used for deleting a data added before at Switch DB. |
| DBOperationsApi | SetPost | POST /Set | It's used for updating a data object that is already added to Switch DB. |
- IO.Swagger.Model.AddResponse
- IO.Swagger.Model.Body
- IO.Swagger.Model.Error
- IO.Swagger.Model.ListOrder
- IO.Swagger.Model.SetResponse
- IO.Swagger.Model.WhereItem
- Mert Sarac - Initial work