Products
Get a filtered list of products
All tables have a corresponding Query class. For example, the table IN_Main has a class IN_MainQuery. The IN_MainQuery class is the DTO used for query operations against the IN_Main table. By setting various properties of an instance of this class, a filtered, ordered set of results can be obtained.
Panel |
---|
borderStyle | solid |
---|
title | Retrieve first 25 products where the PartNo starts with 'a' |
---|
|
Deck |
---|
|
Card |
---|
id | IN_MainQuery_1_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var IN_MainQueryRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_MainQuery() { PartNoStartsWith = "a", OrderBy = "PartNo", Take = 25 };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_Main> IN_MainQueryResponse = client.Get(IN_MainQueryRequest); |
|
Card |
---|
id | IN_MainQuery_1_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25");
} |
|
Card |
---|
id | IN_MainQuery_1_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/IN_Main -d '{"PartNoStartsWith":"a","OrderBy":"PartNo","Take":"25"}' |
|
Card |
---|
id | IN_MainQuery_1_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25&format=json |
Note the &format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
|
Panel |
---|
borderStyle | solid |
---|
title | Retrieve first 25 products where the PartNo starts with 'a', but limit which fields are returned |
---|
|
Deck |
---|
|
Card |
---|
id | IN_MainQuery_2_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var IN_MainQueryRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_MainQuery() { PartNoStartsWith = "a", OrderBy = "PartNo", Take = 25, Fields = "InventoryID,PartNo,Description,Picture" };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_Main> IN_MainQueryResponse = client.Get(IN_MainQueryRequest); |
|
Card |
---|
id | IN_MainQuery_2_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25&Fields=InventoryID,PartNo,Description,Picture");
} |
|
Card |
---|
id | IN_MainQuery_2_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/IN_Main -d '{"PartNoStartsWith":"a","OrderBy":"PartNo","Take":"25","Fields":"InventoryID,PartNo,Description,Picture"}' |
|
Card |
---|
id | IN_MainQuery_2_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25&Fields=InventoryID,PartNo,Description,Picture&format=json |
Note the &format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
|
Panel |
---|
borderStyle | solid |
---|
title | Retrieve next 25 products where the PartNo starts with 'a', and limit which fields are returned |
---|
|
Deck |
---|
|
Card |
---|
id | IN_MainQuery_3_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var IN_MainQueryRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_MainQuery() { PartNoStartsWith = "a", OrderBy = "PartNo", Take = 25, Skip = 25, Fields = "InventoryID,PartNo,Description,Picture" };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_Main> IN_MainQueryResponse = client.Get(IN_MainQueryRequest); |
|
Card |
---|
id | IN_MainQuery_3_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25&Skip=25&Fields=InventoryID,PartNo,Description,Picture");
} |
|
Card |
---|
id | IN_MainQuery_3_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/IN_Main -d '{"PartNoStartsWith":"a","OrderBy":"PartNo","Take":"25","Skip":"25","Fields":"InventoryID,PartNo,Description,Picture"}' |
|
Card |
---|
id | IN_MainQuery_3_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25&Skip=25&Fields=InventoryID,PartNo,Description,Picture&format=json |
Note the &format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
|
Read a product
In order to read a product, the InventoryID must be provided. Note this is a full read of the inventory business logic - so it will include associated elements such as notes, documents, prices and so on.
Panel |
---|
borderStyle | solid |
---|
title | Read a product |
---|
|
Deck |
---|
|
Card |
---|
id | read_a_product_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryGETRequest() { InventoryID = "000000000K00000000BQ" };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Get(inventoryGETRequest); |
|
Card |
---|
id | read_a_product_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ");
} |
|
Card |
---|
id | read_a_product_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ |
|
Card |
---|
id | read_a_product_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryGETRequest for more detail. |
Create a new product
You don't need to provide anything to create a product - a PartNo and InventoryID will be generated for you - however it's usual practice to provide a PartNo. Â All other fields can be provided, but are not mandatory. Â The response DTO will contain the generated InventoryID, and all other fields of the product.
Panel |
---|
borderStyle | solid |
---|
title | Create a new product, and setting the PartNo, Description, DefaultPrice and Picture |
---|
|
Deck |
---|
|
Card |
---|
id | create_a_product_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPOSTRequest { PartNo = "NewPartNo", Description = "A new product", DefaultPrice = 10.50M, Picture = Convert.FromBase64String("R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+Wltdg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x9unX4KaimjDv9aaXOEBteBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Post(inventoryPOSTRequest);
|
|
Card |
---|
id | create_a_product_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { PartNo = "NewPartNo", Description = "A new product", DefaultPrice = 10.50, Picture = Convert.FromBase64String("R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+WltdgYMyZfyywz78AAAAAAAD///8AAP9mZv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory", "POST", json);
} |
|
Card |
---|
id | create_a_product_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory -d '{"PartNo":"NewPartNo","Description":"A new product","DefaultPrice":10.50}' |
|
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail. |
Panel |
---|
borderStyle | solid |
---|
title | Create a product with 2 notes |
---|
|
Deck |
---|
id | create_a_product_with_2_notes |
---|
|
Card |
---|
id | create_a_product_with_2_notes_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPOSTRequest { PartNo = "NewPartNo", Description = "A new product", DefaultPrice = 10.50M };
inventoryPOSTRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "Note text 1" });
inventoryPOSTRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "Note text 2" });
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Post(inventoryPOSTRequest);
|
|
Card |
---|
id | create_a_product_with_2_notes_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { PartNo = "NewPartNo", Description = "A new product", DefaultPrice = 10.50, Notes = new List<object>() { new { NoteText = "Note text 1" }, new { NoteText = "Note text 2" } } });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory", "POST", json);
} |
|
Card |
---|
id | create_a_product_with_2_notes_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory -d '{"PartNo":"NewPartNo","Description":"A new product","DefaultPrice":10.50,"Notes":[{"NoteText":"Note text 1"}, {"NoteText":"NoteText 2"}]}' |
|
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail. |
Update an existing product
Anchor |
---|
| InventoryPatchRequest |
---|
| InventoryPatchRequest |
---|
|
Update an existing product Panel |
---|
borderStyle | solid |
---|
title | Update Description and Picture of a product, add an additional note and update an existing note |
---|
|
Deck |
---|
|
Card |
---|
id | update_a_product_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPATCHRequest { InventoryID = "000000000K00000000BQ", Description = "A new description", Picture = Convert.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FDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") };
inventoryPATCHRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "A new note added" });
inventoryPATCHRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteID = "cb39806c-1b52-411b-a3ba-e16b6281ea63", NoteText = "A modified note text" });
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Patch(inventoryPATCHRequest); |
|
Card |
---|
id | update_a_product_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Description = "A new description", Picture = Convert.FromBase64String("R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+WltdgYMyZfyywz78AAAAAAAD///8AAP9mZv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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jEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=="), Notes = new List<object>() { new { NoteText = "A new note added" }, new { NoteID = "cb39806c-1b52-411b-a3ba-e16b6281ea63", NoteText = "A modified note text" } } });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ", "PATCH", json);
} |
|
Card |
---|
id | update_a_product_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ -d '{"Description":"A new description","Notes":[{"NoteText":"A new note added"},{"NoteID":"cb39806c-1b52-411b-a3ba-e16b6281ea63","NoteText":"A modified note text"}]}' |
|
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail. |
Delete a product
Panel |
---|
borderStyle | solid |
---|
title | Delete a product |
---|
|
Deck |
---|
|
Card |
---|
id | InventoryDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDELETERequest{ InventoryID = "000000000K00000000BQ" };
client.Delete(inventoryDELETERequest); |
|
Card |
---|
id | InventoryDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ", "DELETE", "");
} |
|
Card |
---|
id | InventoryDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ |
|
|
|
Custom Fields
Whilst custom fields can be retrieved, or modified as part of the normal inventory item GET, POST and PATCH operations, you can also use the following requests.
Get a list of Inventory Custom Fields
Panel |
---|
borderStyle | solid |
---|
title | Get all Inventory custom fields |
---|
|
Deck |
---|
id | InventoryCustomFieldsGETManyRequest |
---|
|
Card |
---|
id | InventoryCustomFieldsGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryCustomFieldsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldsGETManyRequest();
var InventoryCustomFieldsGETManyResponse = client.Get(InventoryCustomFieldsGETManyRequest); |
|
Card |
---|
id | InventoryCustomFieldsGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/CustomFields");
} |
|
Card |
---|
id | InventoryCustomFieldsGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/CustomFields |
|
Card |
---|
id | InventoryCustomFieldsGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/CustomFields?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing the a list of the DTO model for a custom field - see the meta data page for the InventoryCustomFieldsGETManyRequest for more detail. |
Get a list of custom field values for a product
Panel |
---|
borderStyle | solid |
---|
title | Get all custom field values for a product |
---|
|
Deck |
---|
id | InventoryCustomFieldValuesGETManyRequest |
---|
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryCustomFieldsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldValuesGETManyRequest() { InventoryID = "000000000K00000000BQ" };
var InventoryCustomFieldsGETManyResponse = client.Get(InventoryCustomFieldsGETManyRequest); |
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues");
} |
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues |
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a list of the Custom Field Value DTO model - see the meta data page for the InventoryCustomFieldValuesGETManyRequest for more detail. |
Get a custom field value for a product
Panel |
---|
borderStyle | solid |
---|
title | Get the custom field value for a specific custom field and product |
---|
|
Deck |
---|
id | InventoryCustomFieldValueGETRequest |
---|
|
Card |
---|
id | InventoryCustomFieldValueGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryCustomFieldValueGETRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldValueGETRequest() { InventoryID = "000000000K00000000BQ", SettingID = "b450e24b-0b83-4650-b812-311f26dfeeb2" };
var InventoryCustomFieldValueGETResponse= client.Get(InventoryCustomFieldValueGETRequest); |
|
Card |
---|
id | InventoryCustomFieldValueGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2");
} |
|
Card |
---|
id | InventoryCustomFieldValueGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2 |
|
Card |
---|
id | InventoryCustomFieldValueGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing the Custom Field Value DTO model - see the meta data page for the InventoryCustomFieldValueGETRequest for more detail. |
Update a custom field value for a product
Panel |
---|
borderStyle | solid |
---|
title | Update a custom field value for a product |
---|
|
Deck |
---|
id | InventoryCustomFieldValuePATCHRequest |
---|
|
Card |
---|
id | InventoryCustomFieldValuePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryCustomFieldValuePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldValuePATCHRequest() { InventoryID = "000000000K00000000BQ", SettingID = "b450e24b-0b83-4650-b812-311f26dfeeb2", Contents = "New Contents" };
var InventoryCustomFieldValuePATCHResponse = client.Get(InventoryCustomFieldValuePATCHRequest); |
|
Card |
---|
id | InventoryCustomFieldValuePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Contents = "New Contents" });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2", "PATCH", json);
} |
|
Card |
---|
id | InventoryCustomFieldValuePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2 -d '{"Contents":"New Contents"}' |
|
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail. |
Price Query
Retrieve a price for a product, given the InventoryID, DebtorID, WarehouseID, date and quantity.
Panel |
---|
borderStyle | solid |
---|
title | Price Query |
---|
|
Deck |
---|
id | InventoryPriceGETRequest |
---|
|
Card |
---|
id | InventoryPriceGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryPriceGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPriceGETRequest { InventoryID = "000000000K00000000BQ", DebtorID = "0000000061000000001V", IN_LogicalID = "ZZZZZZZZZZ0000000000", Date = DateTime.Now, Quantity = 6 };
var InventoryPriceGETResponse = client.Get(InventoryPriceGETRequest); |
|
Card |
---|
id | InventoryPriceGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Pricing/0000000061000000001V/ZZZZZZZZZZ0000000000/2017-09-14/6");
} |
|
Card |
---|
id | InventoryPriceGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Pricing/0000000061000000001V/ZZZZZZZZZZ0000000000/2017-09-14/6 |
|
Card |
---|
id | InventoryPriceGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Pricing/0000000061000000001V/ZZZZZZZZZZ0000000000/2017-09-14/6?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing the DTO model from the business logic - see the meta data page for the InventoryPriceGETRequest for more detail. |
List property operations examples
Inventory Notes
All List properties of DTO's will usually have their own set of routes for various operations. An example is the Notes property of inventory. In the previous example for the Update Existing Product it shows adding a new note by performing a Patch operation on the inventory item. However, the notes list has it's own routes which allow Post, Patch, Get and Delete operations.
Get all notes for a product
While you could always use the IN_NotesQuery class to return all notes with a given InventoryID - There is also a GET method for retrieving all notes for a given InventoryID.
Panel |
---|
borderStyle | solid |
---|
title | Get all notes for a product |
---|
|
Deck |
---|
id | InventoryNotesGETManyRequest |
---|
|
Card |
---|
id | InventoryNotesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryNotesGETManyRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotesGETManyRequest() { InventoryID = "000000000K00000000BQ" };
var inventoryNotesGETManyResponse = client.Get(inventoryNotesGETManyRequest); |
|
Card |
---|
id | InventoryNotesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes");
} |
|
Card |
---|
id | InventoryNotesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes |
|
Card |
---|
id | InventoryNotesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a list of the inventory item note DTO model from the business logic - see the meta data page for the InventoryNotesGETManyRequest for more detail. |
Get a specific note for a product
With a provided InventoryID, and a NoteID a single note can be retrieved.
Panel |
---|
borderStyle | solid |
---|
title | Get a specific note |
---|
|
Deck |
---|
id | InventoryNotesGETRequest |
---|
|
Card |
---|
id | InventoryGETNotesRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryNotesGETRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotesGETRequest() { InventoryID = "000000000K00000000BQ", NoteID = "8F25C1BF-532A-4304-A44F-078AC5D1C54E" };
var inventoryNotesGETResponse= client.Get(inventoryNotesGETRequest); |
|
Card |
---|
id | InventoryNotesGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E");
} |
|
Card |
---|
id | InventoryNotesGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E |
|
Card |
---|
id | InventoryNotesGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a inventory item note DTO model from the business logic - see the meta data page for the InventoryNoteGETRequest for more detail. |
Add a new note
Panel |
---|
borderStyle | solid |
---|
title | Add a new note to a product |
---|
|
Deck |
---|
id | InventoryNotePOSTRequest |
---|
|
Card |
---|
id | InventoryNotePOSTRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
inventoryNotePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotePOSTRequest() { InventoryID = "000000000K00000000BQ", NoteText = "This is a new note" };
inventoryNotesPOSTResponse = client.Post(inventoryNotePOSTRequest);
|
|
Card |
---|
id | InventoryNotePOSTRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { NoteText = "This is a new note" });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes", "POST", json);
} |
|
Card |
---|
id | InventoryNotePOSTRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory -d '{"NoteText":"This is a new note"}' |
|
|
The response returned from the above request will be a json document representing a inventory item note DTO model from the business logic - see the meta data page for the InventoryNotePOSTRequest for more detail. |
Update an existing note
Panel |
---|
borderStyle | solid |
---|
title | Update an existing note |
---|
|
Deck |
---|
id | InventoryNotePATCHRequest |
---|
|
Card |
---|
id | InventoryNotePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
inventoryNotePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotePATCHRequest() { InventoryID = "000000000K00000000BQ", NoteID = "8F25C1BF-532A-4304-A44F-078AC5D1C54E", NoteText = "This is an updated note" };
inventoryNotesPOSTResponse = client.Patch(inventoryNotePOSTRequest);
|
|
Card |
---|
id | InventoryNotePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { NoteText = "This is an updated note" });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E", "PATCH", json);
} |
|
Card |
---|
id | InventoryNotePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E -d '{"NoteText":"This is an updated note"}' |
|
|
The response returned from the above request will be a json document representing a inventory item note DTO model from the business logic - see the meta data page for the InventoryNotePATCHRequest for more detail. |
Delete a note for a product
Panel |
---|
borderStyle | solid |
---|
title | Delete a specific note |
---|
|
Deck |
---|
id | InventoryNoteDELETERequest |
---|
|
Card |
---|
id | InventoryNoteDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
inventoryNoteDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNoteDELETERequest() { InventoryID = "000000000K00000000BQ", NoteID = "8F25C1BF-532A-4304-A44F-078AC5D1C54E" };
client.Delete(inventoryNoteDELETERequest ); |
|
Card |
---|
id | InventoryNoteDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E", "DELETE", "");
} |
|
Card |
---|
id | InventoryNoteDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E |
|
|
|