Skip to main content

I am trying to integrate the RedCap System using model in Skuid.


Following API request is working fine external tool:


#!/bin/sh

DATA=“token=XXXXXXXXXXXX&content=project&format=json&returnFormat=json”

CURL=which curl

$CURL -H “Content-Type: application/x-www-form-urlencoded”

-H “Accept: application/json”

-X POST

-d $DATA
https://redcap.XXXX.org/api/


But, when I trying to build same request from Model with following, I am getting error:


  1. Model behavior: Read/Write

  2. Method Query:

    Data source URL: /api/

    Data source HTTP verb: POST

    Request body contents: As templated request body

    Custom request:

    {

    ‘token’: ‘XXXXXXXXXXXX’,

    ‘content’: ‘project’,

    ‘format’: ‘json’,

    ‘returnFormat’: ‘json’

    }

Please let me know what I am missing. Thanks in advance.

Not 100% sure here - but I think your Custom Request is formatted as JSON - when the data in your request (the DATA section) is simply in a URL string format. You might not even need the tempatated request body - if the DATA section is just part of the URL that gets sent in the HTTP request.


Reply