How to find a list of PROMIS calibrations that are available through the API
Syntax
- https://assessmentcenter.net/ac_api/2014-01/Calibrations/ - returns a list of all calibrations (i.e. FormOID and Name).
- https://assessmentcenter.net/ac_api/2014-01/Calibrations/{.xml or .json} - returns a list of all calibrations in the specified format.
(i.e. https://assessmentcenter.net/ac_api/2014-01/Calibrations/.json) - https://assessmentcenter.net/ac_api/2014-01/Calibrations/{FormOID} - returns the calibration as an html page
- https://assessmentcenter.net/ac_api/2014-01/Calibrations/{FormOID}.xml - returns the specified calibration in xml format
- https://assessmentcenter.net/ac_api/2014-01/Calibrations/{FormOID}.json - returns the specified calibration in json format
Remarks
If the FormOID does not match an available calibration, then the list of all calibrations is returned. API Home Try it!Sample code for https://assessmentcenter.net/ac_api/2014-01/Calibrations
<script langauge="javascript" src="jquery-1.7.1.min.js"></script> <script language="javascript" src="crypto.js"></script> <script type='text/javascript' version='1.3'> var Server = https://assessmentcenter.net/ac_api; var FormOID = "D2FA612D-C290-4B88-957D-1C27F48EE58C"; // Sample form -- replace with your FormOID function listCalibrations() { // Returns the following calibration format as json $.ajax({ url: Server + "/2014-01/Calibrations/" + FormOID + ".json", // Sample calibration cache: false, type: "POST", data: "", dataType: "json", beforeSend: function(xhr) { var bytes = Crypto.charenc.Binary.stringToBytes(document.getElementById("txtRegistration").value + ":" + document.getElementById("txtToken").value); var base64 = Crypto.util.bytesToBase64(bytes); xhr.setRequestHeader("Authorization", "Basic " + base64); }, success: function(data) { var screen ="ItemID : A_GRM<br />"; for (var j=0; j < data.Items.length; j++) { screen = screen + data.Items[j].ID + " : " + data.Items[j].A_GRM + "<br />" } document.getElementById("Content").innerHTML = screen; }, error: function(jqXHR, textStatus, errorThrown) { document.write(jqXHR.responseText + ':' + textStatus + ':' + errorThrown); } }) }
Based on twillio example to call RESTful services. (http://www.twilio.com/docs/api/rest)
using System; using System.Collections; using System.Configuration; using System.IO; using System.Net; using System.Web; using System.Text; using System.Text.RegularExpressions; public class TestHarness { static void Main(string[] args) { string REGISTRATIONID ="31839849-ECE0-4F5E-BEAE-3D655ED65E31"; // Sample registration -- replace with your RegistrationOID string TOKEN ="F3738486-5A7D-41EF-8044-DCBAF800E2D4"; // Sample token -- replace with your TokenOID string API_URL = "https://assessmentcenter.net/ac_api/2014-01/Calibrations/.xml"; string authstring = Convert.ToBase64String(Encoding.ASCII.GetBytes(String.Format("{0}:{1}", REGISTRATIONID, TOKEN))); ServicePointManager.Expect100Continue = false; Byte[] postbytes = Encoding.ASCII.GetBytes(string.Empty); WebClient client = new WebClient(); client.Headers.Add("Authorization", String.Format("Basic {0}", authstring)); client.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); byte[] resp = client.UploadData(API_URL, "post", postbytes); Console.WriteLine(Encoding.ASCII.GetString(resp)); } }
Request:https://assessmentcenter.net/ac_api/2014-01/Calibrations/.json
Response:
Response:
{ "Calibration": [ { "OID": "C4ADCFAB-6B75-498E-9E94-AFD3BA211DC4", "Name": "PROMIS Bank v1.0 - Pain Behavior" }, { "OID": "3156A7E4-CC27-4504-962A-B8472CAF1A59", "Name": "PROMIS Bank v1.0 Psychosocial Illness Impact Neg" }, { "OID": "9DA933EC-4E3B-4409-8785-9D692010B7A2", "Name":"PROMIS Ped Bank v1.0 - Peer Rel" }, { "OID": "5FAF7608-6175-4B89-A410-1E88D157E903", "Name": "PROMIS Bank v1.0 Applied Cog Abilities" }, { "OID": "C0E737C9-EF7C-4842-8661-4B00F82C0FED", "Name":"PROMIS Ped Bank v1.0 - Fatigue" } ] }
// Requesting one calibration to be returned as an "Items" array Request:https://assessmentcenter.net/ac_api/2014-01/Calibrations/C0E737C9-EF7C-4842-8661-4B00F82C0FED.json
Response:
{ "FormOID": "C0E737C9-EF7C-4842-8661-4B00F82C0FED", "Form": "PROMIS pediatric item bank for fatigue.", "Properties": [ { "MinNumItems": "5" }, { "MaxNumItems": "12" }, { "IRTModel": "0" }, { "SelectionMethod": "1" }, { "MinTheta": "-4.00" }, { "MaxTheta": "4.00" }, { "ThetaIncrement": "0.1000" }, { "MaxStdErr": "0.40" }, { "SelectionGroupSize": "1" }, { "LogisticScaling": "1.0000" }, { "DistMean": "0.00" }, { "DistStdDev": "1.00" }, { "FirstItem": "" } ], "Items": [ { "FormItemOID": "0498B286-AB56-405A-B5D8-E4EE2D8D928E", "ID": "3548R1", "A_GRM": "1.56457", "Map": [ { "ItemResponseOID": "2C57C1F7-EF7F-4E4B-8021-722A614AC8B3", "StepOrder": "0", "Threshold": "0.5439" }, { "ItemResponseOID": "EBD7076A-A3BC-45FB-AE1E-35978AA87017", "StepOrder": "1", "Threshold": "1.3687" }, { "ItemResponseOID": "D6F45EB7-C4A3-41D9-B575-1374F32A21F0", "StepOrder": "2", "Threshold": "2.2485" }, { "ItemResponseOID": "2D20F0D5-122C-4D95-B3D8-D38245B82A42", "StepOrder": "3", "Threshold": "2.8131" } ] }, ... { "FormItemOID"... } ] // Items array }
// Requesting all forms available to be returned as "Form" nodes
Request: https://assessmentcenter.net/ac_api/2014-01/Calibrations/.xml
Response:
Response:
<?xml version="1.0" encoding="utf-8"?> <calibrations> <calibration OID="C4ADCFAB-6B75-498E-9E94-AFD3BA211DC4" name="PROMIS Bank v1.0 - Pain Behavior" /> <calibration OID="3156A7E4-CC27-4504-962A-B8472CAF1A59" name="PROMIS Bank v1.0 Psychosocial Illness Impact Neg" /> <calibration OID="9DA933EC-4E3B-4409-8785-9D692010B7A2" name="PROMIS Ped Bank v1.0 - Peer Rel" /> <calibration OID="5FAF7608-6175-4B89-A410-1E88D157E903" name="PROMIS Bank v1.0 Applied Cog Abilities" /> <calibration OID="C0E737C9-EF7C-4842-8661-4B00F82C0FED" name="PROMIS Ped Bank v1.0 - Fatigue" /> <calibration OID="8C3AA645-DC1D-4762-BCD2-E2F8DAC0B0EB" name="PROMIS Parent Proxy Bank v1.0 ?Upper Extremity" /> <calibration OID="3F2FCBBA-E8A1-4D0B-A9AE-9AEABF5BF60B" name="PROMIS Ped Bank v1.0 - Upper Extremity" /> </calibrations>