MCServe API :: Load MCServe Sites (One specific)

Load a MCServe Site

Example (.NET C#) :
MCServeApi MCServeApi = new MCServeApi(true);
String Command = ApiCommands.WEBSITE;
ApiValues Values = new ApiValues();
Values.Add("Uri", "http://res.mcserve.org");
ApiResult Response = null;

Response = MCServeApi.Query(Command, Values);
JsonWebsiteResult JsonResult = JsonConvert.DeserializeObject<JsonWebsiteResult>(Response.Message);

Example (.NET Visual Basic) :
Dim MCServeApi As New MCServeApi(True)
Dim Command As [String] = ApiCommands.WEBSITE
Dim Values As New ApiValues()
Values.Add("Uri", "http://res.mcserve.org")
Dim Response As ApiResult = Nothing

Response = MCServeApi.Query(Command, Values)
Dim JsonResult As JsonWebsiteResult = JsonConvert.DeserializeObject(Of JsonWebsiteResult)(Response.Message)

Possible values :
Object Value Example
Uri "http://res.mcserve.org" Values.Add("Uri", "http://res.mcserve.org");
Guid "53e99b9f-400f-4742-a3db-ff50778f97e4" Values.Add("Guid", "53e99b9f-400f-4742-a3db-ff50778f97e4");
Name "RESOURCES" Values.Add("Name", "RESOURCES");


Response :
{
    "Result": true,
    "Message": "The API query was successful",
    "Code": 0,
    "Sites": [
        {
            "Guid": "53e99b9f-400f-4742-a3db-ff50778f97e4",
            "Uri": "http://res.mcserve.org",
            "Title": "MCServe Resources",
            "Name": "RESOURCES"
        }
    ]
}

Last edited Mar 11, 2013 at 6:58 PM by Xe77a, version 11

Comments

No comments yet.