Skip to content

Commit

Permalink
Merge pull request #22 from cctrbic/NET-CORE-1.X
Browse files Browse the repository at this point in the history
Net core 1.x
  • Loading branch information
cctrbic authored Aug 31, 2017
2 parents 7ad44c7 + 242b87d commit cc38b51
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,49 @@
# redcap-api
redcap-api is a C# API (Application Programming Interface) for REDCap, that lets you:
# REDCap API Library for C#
The REDCap API (Application Programming Interface) for REDCap, lets you:
export/import/delete data in REDCap
export/import/delete project information (e.g., field names and types) in REDCap

__Usage__:

1. dotnet restore
2. Add reference to library in your project
3. Add "using Redcap.Interfaces" namespace (contains some enums for redcap optional params)
2. Add reference to the library in your project
3. Add "using Redcap" namespace
4. instantiate a new instance of the redcapapi object

__Example__
```C#

var rc = new Redcap.RedcapApi("redcap token here", "your redcap api endpoint here")
using System;
using Newtonsoft.Json;
using Redcap;
using Redcap.Models;

```
namespace RedcapApiDemo
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Redcap Api Demo Started!");

```C#
var redcap_api = new RedcapApi("3D57A7FA57C8A43F6C8803A84BB3957B", "http://localhost/redcap/api/");

var result = redcap_api.GetRecordAsync("1", RedcapFormat.json, RedcapDataType.flat, ReturnFormat.json, null, null, null, null).Result;
var data = JsonConvert.DeserializeObject(result);
Console.WriteLine(data);
Console.ReadLine();

var version = await rc.GetRedcapVersionAsync(RedcapFormat.json, RedcapDataType.flat);
}
}
}

```

__Install directly in Package Manager Console__
__Install directly in Package Manager Console or Command Line Interface__

``` Install-Package RedcapAPI ```
``` Install-Package RedcapAPI -Version 0.2.6-alpha-release ```
```dotnet add package RedcapAPI --version 0.2.6-alpha-release ```

__Demo__
__DEMO__

https://github.com/cctrbic/redcap-api-demo
A console project has been included with the source code to get started.

0 comments on commit cc38b51

Please sign in to comment.