-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from cctrbic/NET-CORE-1.X
Net core 1.x
- Loading branch information
Showing
1 changed file
with
29 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |