Documentation :: TravelNurseSource.com

TravelNurseSource API v2.0

Getting Started

The TravelNurseSource API v2.0 is a RESTful API. Requests are made using standard HTTP methods such as GET, POST and DELETE.

The Basics

  • To protect sensitive information, the API communicates ONLY over SSL/TLS-encrypted connections.
  • The API speaks JSON & XML fluently. For maximum performance, we recommend using JSON instead of XML.
  • All date/time fields are formatted according to the rules specified in RFC 3339.

Authentication

Every request you make to our API must be accompanied by your API key. You can find your key in your Agency Admin panel. Our API uses HTTP Basic authentication to include the key with your requests.

How to Send Requests

To make implementing our API easier, we've provided examples of how to connect to our API in some popular programming languages:

Sample GET Request
curl -X GET 'https://www.travelnursesource.com/api/v2.0/leads.json' \
-u YOUR_API_KEY_HERE:
Sample POST Request
curl -X POST 'https://www.travelnursesource.com/api/v2.0/jobs.json' \
-d 'STRING_CONTAINING_JSON_JOB_DATA' \
-u YOUR_API_KEY_HERE:
Sample DELETE Request
curl -X DELETE 'https://www.travelnursesource.com/api/v2.0/jobs.json' \
-d '["abcd1234","abcd5678"]' \
-u YOUR_API_KEY_HERE:
Sample GETRequest
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.travelnursesource.com/api/v2.0/leads.json");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "YOUR_API_KEY_HERE:"); //Note the colon after your API key (HTTP Basic Auth expects [username:password] format; your API key is your username and there is no password)
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Connection: close"));

$response = curl_exec($ch);
Sample POST Request
$json = "STRING_CONTAINING_JSON_JOB_DATA";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.travelnursesource.com/api/v2.0/jobs.json");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "YOUR_API_KEY_HERE:"); //Note the colon after your API key (HTTP Basic Auth expects [username:password] format; your API key is your username and there is no password)
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Connection: close"));

$response = curl_exec($ch);
Sample DELETE Request
$json = json_encode(array(
    "abcd1234",
    "abcd5678"
));

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.travelnursesource.com/api/v2.0/jobs.json");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST ,"DELETE");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "YOUR_API_KEY_HERE:"); //Note the colon after your API key (HTTP Basic Auth expects [username:password] format; your API key is your username and there is no password)
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Connection: close"));

$response = curl_exec($ch);
Sample GET Request
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://www.travelnursesource.com/api/v2.0/leads.json");
request.Method = "GET";
request.Credentials = new NetworkCredential(YOUR_API_KEY_HERE,"");

WebResponse response = request.GetResponse();
Stream data = response.GetResponseStream();
StreamReader reader = new StreamReader(data);
string responseFromServer = reader.ReadToEnd();

reader.Close();
data.Close();
response.Close();
Sample POST Request
using System.IO;
using System.Net;
using System.Text;
using System.Web.Helpers;

string json = Json.Encode(object);
byte[] byteArray = Encoding.UTF8.GetBytes(json);

WebRequest request = WebRequest.Create("https://www.travelnursesource.com/api/v2.0/jobs.json");
request.Method = "POST";
request.Credentials = new NetworkCredential(YOUR_API_KEY_HERE,"");
request.ContentLength = byteArray.Length;
request.ContentType = "application/x-www-form-urlencoded";

Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();

WebResponse response = request.GetResponse();
Stream data = response.GetResponseStream();
StreamReader reader = new StreamReader(data);
string responseFromServer = reader.ReadToEnd();

reader.Close();
data.Close();
response.Close();
Sample DELETE Request
using System.IO;
using System.Net;
using System.Text;
using System.Web.Helpers;

string json = Json.Encode(object);
byte[] byteArray = Encoding.UTF8.GetBytes(json);

WebRequest request = WebRequest.Create("https://www.travelnursesource.com/api/v2.0/jobs.json");
request.Method = "DELETE";
request.Credentials = new NetworkCredential(YOUR_API_KEY_HERE,"");
request.ContentLength = byteArray.Length;
request.ContentType = "application/x-www-form-urlencoded";

Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();

WebResponse response = request.GetResponse();
Stream data = response.GetResponseStream();
StreamReader reader = new StreamReader(data);
string responseFromServer = reader.ReadToEnd();

reader.Close();
data.Close();
response.Close();