<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PROC HTTP error calling REDCap API in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-HTTP-error-calling-REDCap-API/m-p/603868#M76488</link>
    <description>&lt;P&gt;redCap has changed the api call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;amp;content=record&amp;amp;format=csv&amp;amp;type=flat&amp;amp;rawOrLabel=raw&amp;amp;rawOrLabelHeaders=raw&amp;amp;exportCheckboxLabel=false&amp;amp;exportSurveyFields=false&amp;amp;exportDataAccessGroups=false&amp;amp;returnFormat=csv&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I sugges you use the api playground in RedCap to generate your api call or read the documentation.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2019 14:30:41 GMT</pubDate>
    <dc:creator>rudfaden</dc:creator>
    <dc:date>2019-11-13T14:30:41Z</dc:date>
    <item>
      <title>PROC HTTP error calling REDCap API</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-HTTP-error-calling-REDCap-API/m-p/599454#M76310</link>
      <description>&lt;P&gt;I've researched for awhile, coming across several posts and SAS User Group presentations/papers on how to use SAS to call the REDCap API. However, all my attempts result in the same outcome.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename my_in "C:\...api_parameters.txt";
filename my_out "C:\...api_redcap_data.csv";
filename status "C:\redcap_status.txt";

%let mytoken = tokenforredcapprojectwithnoquotes;

data _null_ ;
file my_in ;
put "%NRStr(token=)&amp;amp;mytoken%NRStr(&amp;amp;content=record&amp;amp;type=flat&amp;amp;format=csv)&amp;amp;";
run;

proc http
in=my_in
out= my_out
headerout = status
url ="https://redcap.institution.edu/api/"
method="post";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The API parameters file is populated with this: token=tokenfromletstatement&amp;amp;content=record&amp;amp;type=flat&amp;amp;format=csv&amp;amp;&lt;/P&gt;&lt;P&gt;The status and data files are not populated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the error message:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR:  An exception has been encountered.
Please contact technical support and provide them with the following traceback information:
 
The SAS task name is [HTTP (2)]
ERROR:  Read Access Violation HTTP (2)
Exception occurred at (02467E08)
Task Traceback
Address   Frame     (DBGHELP API Version 4.0 rev 5)
0000000002467E08  000000000BB2E730  tkmk:tkBoot+0x460C8
0000000002467F41  000000000BB2E7B0  tkmk:tkBoot+0x46201
00000000024697A6  000000000BB2E800  tkmk:tkBoot+0x47A66
000000000245442B  000000000BB2E870  tkmk:tkBoot+0x326EB
000000000331FA3E  000000000BB2E878  sashost:Main+0xA7F1E
000000000904E6F8  000000000BB2E8F8  tkhttp:tkextver+0x318
0000000008FCD741  000000000BB2F290  tkhttp:tkhttp+0xC741
0000000008FC6CEC  000000000BB2F390  tkhttp:tkhttp+0x5CEC
3                                                          The SAS System                             13:38 Friday, October 25, 2019

0000000008D95020  000000000BB2F398  sashttp:tkvercn1+0x3FE0
0000000008D91B20  000000000BB2F9E0  sashttp:tkvercn1+0xAE0
000000000483C477  000000000BB2F9E8  sasxshel:tkvercn1+0x4B437
0000000008D98622  000000000BB2FB00  sashttp:tkvercn1+0x75E2
0000000008D9115A  000000000BB2FBF0  sashttp:tkvercn1+0x11A
0000000003288A2B  000000000BB2FF20  sashost:Main+0x10F0B
000000000328E66D  000000000BB2FF50  sashost:Main+0x16B4D
00007FFED8BC3DC4  000000000BB2FF58  KERNEL32:BaseThreadInitThunk+0x14
00007FFED9273691  000000000BB2FF88  ntdll:RtlUserThreadStart+0x21&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is driving me crazy on why it's not working. Any help would be appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 21:23:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-HTTP-error-calling-REDCap-API/m-p/599454#M76310</guid>
      <dc:creator>jkurka</dc:creator>
      <dc:date>2019-10-25T21:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: PROC HTTP error calling REDCap API</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-HTTP-error-calling-REDCap-API/m-p/603868#M76488</link>
      <description>&lt;P&gt;redCap has changed the api call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;amp;content=record&amp;amp;format=csv&amp;amp;type=flat&amp;amp;rawOrLabel=raw&amp;amp;rawOrLabelHeaders=raw&amp;amp;exportCheckboxLabel=false&amp;amp;exportSurveyFields=false&amp;amp;exportDataAccessGroups=false&amp;amp;returnFormat=csv&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I sugges you use the api playground in RedCap to generate your api call or read the documentation.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 14:30:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-HTTP-error-calling-REDCap-API/m-p/603868#M76488</guid>
      <dc:creator>rudfaden</dc:creator>
      <dc:date>2019-11-13T14:30:41Z</dc:date>
    </item>
  </channel>
</rss>

