Skip to content

Commit cc38b51

Browse files
authored
Merge pull request #22 from cctrbic/NET-CORE-1.X
Net core 1.x
2 parents 7ad44c7 + 242b87d commit cc38b51

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

README.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,49 @@
1-
# redcap-api
2-
redcap-api is a C# API (Application Programming Interface) for REDCap, that lets you:
1+
# REDCap API Library for C#
2+
The REDCap API (Application Programming Interface) for REDCap, lets you:
33
export/import/delete data in REDCap
44
export/import/delete project information (e.g., field names and types) in REDCap
55

66
__Usage__:
77

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

1313
__Example__
1414
```C#
1515

16-
var rc = new Redcap.RedcapApi("redcap token here", "your redcap api endpoint here")
16+
using System;
17+
using Newtonsoft.Json;
18+
using Redcap;
19+
using Redcap.Models;
1720

18-
```
21+
namespace RedcapApiDemo
22+
{
23+
class Program
24+
{
25+
static void Main(string[] args)
26+
{
27+
Console.WriteLine("Redcap Api Demo Started!");
1928

20-
```C#
29+
var redcap_api = new RedcapApi("3D57A7FA57C8A43F6C8803A84BB3957B", "http://localhost/redcap/api/");
30+
31+
var result = redcap_api.GetRecordAsync("1", RedcapFormat.json, RedcapDataType.flat, ReturnFormat.json, null, null, null, null).Result;
32+
var data = JsonConvert.DeserializeObject(result);
33+
Console.WriteLine(data);
34+
Console.ReadLine();
2135

22-
var version = await rc.GetRedcapVersionAsync(RedcapFormat.json, RedcapDataType.flat);
36+
}
37+
}
38+
}
2339

2440
```
2541

26-
__Install directly in Package Manager Console__
42+
__Install directly in Package Manager Console or Command Line Interface__
2743

28-
``` Install-Package RedcapAPI ```
44+
``` Install-Package RedcapAPI -Version 0.2.6-alpha-release ```
45+
```dotnet add package RedcapAPI --version 0.2.6-alpha-release ```
2946

30-
__Demo__
47+
__DEMO__
3148

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

0 commit comments

Comments
 (0)