This is the temporary rest point service for the debate-n-go api
Author: Justin Walrath
$.ajax({
type: "GET",
url: "http://url.com/login/<sample-unique-url>",
contentType: "application/json",
success: function(data, textStatus, jqXHR) {
//Process the results here.
}
});
sendData = { user_id: "<crazyLongUserId>", new_username: "<newUsername>" };
$.ajax({
type: "POST",
url: "http://url.com/updateUsername/"
data: JSON.stringify(sendData),
contentType: "application/json",
success: function(data, textStatus, jqXHR) {
//Process the results here.
}
});
sendData = { user_id: "<crazyLongUserId>", option_id: "<option id>", vote_options: <array of the vote options> };
$.ajax({
type: "POST",
url: "http://url.com/userVote/"
data: JSON.stringify(sendData),
contentType: "application/json",
success: function(data, textStatus, jqXHR) {
//Process the results here.
}
});
sendData = { user_id: "<crazyLongUserId>", title: "The tagline/title of the message", message: "The message", vote_options: <array of the vote options>, vote_topic_id: "<topic id>" };
$.ajax({
type: "POST",
url: "http://url.com/leaveComment/"
data: JSON.stringify(sendData),
contentType: "application/json",
success: function(data, textStatus, jqXHR) {
//Process the results here.
}
});
sendData = { user_id: "<crazyLongUserId>", message: "The message", parent_id: "parentID" };
$.ajax({
type: "POST",
url: "http://url.com/leaveReply/"
data: JSON.stringify(sendData),
contentType: "application/json",
success: function(data, textStatus, jqXHR) {
//Process the results here.
}
});
sendData = { user_id: "<crazyLongUserId>", vote_topic_id: "<topic id>" };
$.ajax({
type: "POST",
url: "http://url.com/refreshMessages/"
data: JSON.stringify(sendData),
contentType: "application/json",
success: function(data, textStatus, jqXHR) {
//Process the results here.
}
});
sendData = { user_id: "<crazyLongUserId>", option_id: "<option id>" };
$.ajax({
type: "POST",
url: "http://url.com/refreshOptionMessageKeys/"
data: JSON.stringify(sendData),
contentType: "application/json",
success: function(data, textStatus, jqXHR) {
//Process the results here.
}
});
To import the code:
./example-data/IMPORT.sh
You will need to run each command found in example-data/IMPORT.sh from the command line to load the data into the mongodb.