Skip to content

Getting Started⚓︎

The webqueue2 API is organized around REST. The API has resource oriented URLs, accepts and returns JSON encoded request bodies, can be modified via the query string and uses standard HTTP response codes and verbs.

You can use the webqueue2 API hosted at https://engineering.purdue.edu/webqueue/webqueue2/build/api or install it on your own machine.

Basic Usage⚓︎

Get the first item in CE queue.

let access_token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE";
let queue = "ce";

fetch(
    `https://engineering.purdue.edu/webqueue/webqueue2/build/api/data/${queue}`,
    { headers: {"Authorization":`Bearer ${access_token}` }}
)
.then( resp => resp.json() )
.then( data => console.log( data[0].items[0] ));
// Expected Output
{ queue: "ce", number: 17, lastUpdated: "2021-03-29T17:12:00-0400" ... }

Get the subject of an CE 1.

let access_token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE";
let queue = "ce";
let item_number = 1;

fetch(
    `https://engineering.purdue.edu/webqueue/webqueue2/build/api/data/${queue}/${item_number}`,
    { headers: {"Authorization":`Bearer ${access_token}` }}
)
.then( resp => resp.json() )
.then( data => console.log( data.subject ));
// Expected Output
"Linux Server Purchase"