RedcapAPI 1.3.7
dotnet add package RedcapAPI --version 1.3.7
NuGet\Install-Package RedcapAPI -Version 1.3.7
<PackageReference Include="RedcapAPI" Version="1.3.7" />
<PackageVersion Include="RedcapAPI" Version="1.3.7" />
<PackageReference Include="RedcapAPI" />
paket add RedcapAPI --version 1.3.7
#r "nuget: RedcapAPI, 1.3.7"
#:package RedcapAPI@1.3.7
#addin nuget:?package=RedcapAPI&version=1.3.7
#tool nuget:?package=RedcapAPI&version=1.3.7
REDCap API Library for .NET
The REDCap Api Library provides the ability to interact with REDCap programmatically using various .NET languages(C#,F#,VB.NET);
Prerequisites
- Local redcap instance installed (visit https://project-redcap.org) if you need to download files(assuming you have access)
- Create a new project with "Demographics" for the template; this gives you a basic project to work with.
- Create an api token for yourself, replace that with the tokens you see on the "RedcapApiTests.cs" files, and others
- You'll may need to add a field type of "file_upload" so that you can test the file upload interface of the API
- Build the solution, then run the demo project to see the results.
API METHODS SUPPORTED (Not all listed)
- ExportLoggingAsync
- ExportDagsAsync
- ImportDagsAsync
- DeleteDagsAsync
- ExportArmsAsync
- ImportArmsAsync
- DeleteArmsAsync
- ExportEventAsync
- ImportEventAsync
- ExportFileAsync
- ImportFileAsync
- DeleteFileAsync
- ExportMetaDataAsync
- ExportRecordsAsync
- ImportRecordsAsync
- ExportRedcapVersionAsync
- ExportUsersAsync
Usage:
- dotnet restore
- Add reference to the library in your project, or download from nuget into project
- Add "using Redcap" namespace
- Add "using Redcap.Models" for convenience
- Replace the demo api token with your test project or you can import the data dictionary in \Docs thats provided for convenience.
- Feel free to contribute
Sample / Example
using Newtonsoft.Json;
using Redcap;
namespace RedcapApiDemo
{
internal class Program
{
static async Task<int> Main(string[] args)
{
var apiToken = "3D57A7FA57C8A43F6C8803A84BB3957B";
var redcap_api = new RedcapApi("http://localhost/redcap/api/");
var result = await redcap_api.ExportRecordsAsync(apiToken);
var records = JsonConvert.DeserializeObject(result);
Console.WriteLine(records);
Console.ReadLine();
return 0;
}
}
}
Install directly in Package Manager Console or Command Line Interface
Package Manager
Install-Package RedcapAPI -Version 1.3.7
.NET CLI
dotnet add package RedcapAPI --version 1.3.7
Paket CLI
paket add RedcapAPI --version 1.3.7
Example Project
A console project has been included with the source code to get started. Some examples of method usage. You can use this to get started potentially.
Test Project
A project with associated test cases is included. Make sure to change the api token
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Newtonsoft.Json (>= 13.0.3)
- Serilog (>= 4.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.3.7 | 2,536 | 11/7/2024 |
1.3.6 | 1,835 | 7/16/2024 |
1.3.5 | 1,124 | 5/9/2024 |
1.3.4 | 315 | 5/8/2024 |
1.3.3 | 2,035 | 10/13/2023 |
1.3.2 | 848 | 5/20/2023 |
1.3.1 | 1,320 | 1/9/2023 |
1.3.0 | 797 | 1/7/2023 |
1.1.0 | 2,324 | 2/5/2021 |
1.0.9 | 1,114 | 10/3/2020 |
1.0.8 | 2,713 | 1/27/2020 |
1.0.7 | 1,297 | 2/24/2019 |
1.0.6 | 898 | 2/13/2019 |
1.0.5 | 862 | 2/12/2019 |
Add support for new API Method:
- RandomizeRecord - This method allows the current API user to randomize a record. This follows the Randomization 2.0 Update in REDCap v14.7.0