RedcapAPI 1.3.5

dotnet add package RedcapAPI --version 1.3.5
NuGet\Install-Package RedcapAPI -Version 1.3.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RedcapAPI" Version="1.3.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RedcapAPI --version 1.3.5
#r "nuget: RedcapAPI, 1.3.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install RedcapAPI as a Cake Addin
#addin nuget:?package=RedcapAPI&version=1.3.5

// Install RedcapAPI as a Cake Tool
#tool nuget:?package=RedcapAPI&version=1.3.5

Build Status

NuGet license

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

  1. Local redcap instance installed (visit https://project-redcap.org) if you need to download files(assuming you have access)
  2. Create a new project with "Demographics" for the template; this gives you a basic project to work with.
  3. Create an api token for yourself, replace that with the tokens you see on the "RedcapApiTests.cs" files, and others
  4. You'll may need to add a field type of "file_upload" so that you can test the file upload interface of the API
  5. 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:

  1. dotnet restore
  2. Add reference to the library in your project, or download from nuget into project
  3. Add "using Redcap" namespace
  4. Add "using Redcap.Models" for convenience
  5. Replace the demo api token with your test project or you can import the data dictionary in \Docs thats provided for convenience.
  6. 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.5

.NET CLI

dotnet add package RedcapAPI --version 1.3.5

Paket CLI

paket add RedcapAPI --version 1.3.5

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.5 694 5/9/2024
1.3.4 87 5/8/2024
1.3.3 1,670 10/13/2023
1.3.2 622 5/20/2023
1.3.1 659 1/9/2023
1.3.0 284 1/7/2023
1.1.0 1,653 2/5/2021
1.0.9 704 10/3/2020
1.0.8 2,487 1/27/2020
1.0.7 1,110 2/24/2019
1.0.6 709 2/13/2019
1.0.5 672 2/12/2019
1.0.4-beta 632 9/28/2018
1.0.1-beta 683 7/3/2018
0.4.0-alpha 825 9/22/2017
0.3.0-alpha 831 9/15/2017
0.2.8-alpha 969 9/13/2017
0.2.6-alpha-release 844 8/31/2017
0.2.1 1,177 8/2/2017

-Enhancements: Provide the ability to pass a timeout argument to individual http requests,
       -multiple bug fixes