Hello,
For now i can not find an option to download an particularly order.
is this not possible without using the api ?
if not is it an idea to add an option to the more action button for an xml file download ?
it would be very convenient for me !
kind regards
peter
Comments
I dont need the know the order details but only the items in an order downloadable as an xml file
I did not say that very clearly....
You can use the API:
Items
GET https://api.brickowl.com/v1/order/items
Retrieve order items
Arguments
order_id - The orders unique ID
This requires some programming. In C# you can download this result and use the function SaveToXML.
Frank
thanks for your answer, I placed it in the suggestion section because it would be handy to have this function. but programming something like this is also not a problem
I understand what you are saying but how can I connect to the database with C#?
greetings
peter
I tried to achieve something similar when I designed my custom BrickOwl Integration App, you can take a look at a code sample here: https://dotnetfiddle.net/w6WTGP
Feel free to reuse & modify my code. This will allow you to get order details.
You can use other API calls (i.e. the one mentioned by Frank) to retrieve order items for a given order. I don't have a sample for that, but you can figure this out yourself
All you need is a NewtonSoft JSON library installed and your own BrickOwl API key.
I hope it helps, at least it will give you an overview on how to use BO API through C#.
You may need to modify my code and add some extra stuff if you're looking for different functionality.
Regards
Monika
It's like Monika shows in her example. You get the results from the BO-website. This result is in JSON.
Here is my code to save the result into XML:
private void getUrl(string uri, string parameters, string fileName)
{
string myStringWebResource = null;
string result = null;
// Create a new WebClient instance.
WebClient webClient = new WebClient();
// Concatenate the domain with the Web resource filename.
myStringWebResource = uri + "?" + parameters;
Console.WriteLine("Downloading File \"{0}\" from \"{1}\" .......\n\n", fileName, myStringWebResource);
// Download the Web resource and save it into the current filesystem folder.
result = webClient.DownloadString(myStringWebResource);
// To convert JSON text contained in string json into an XML doc
XmlDocument doc = (XmlDocument)JsonConvert.DeserializeXmlNode( "{\"inventory\":" + result + "}", "bo_inventory");
doc.Save(fileName);
Console.WriteLine("Successfully Downloaded File \"{0}\" from \"{1}\"", fileName, myStringWebResource);
Console.WriteLine("\nDownloaded file saved in the following file system folder:\n\t" + Application.StartupPath);
}
Just declare a JSON and XML parser.
Succes.
Frank