var client = new RestClient("https://web.anbaronline.ir/api/v1/GetAllStock?
token=Po3bExGM8UmgfAgWaBcNxg&store=Product");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
$(document).ready(function () {
var token = "Po3bExGM8UmgfAgWaBcNxg";
var store = "Product";
$.ajax({
type: "Get",
url: "https://web.anbaronline.ir/api/v1/GetAllStock",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: { token: token, store: store },
success: function (data) {
//do something
},
error: function (msg) {
//error
}
});
});
Show total inventory (GetAllStock): https://web.anbaronline.ir/api/v1/GetAllStock parameters Data Type token string store string
setUrl('https://web.anbaronline.ir/api/v1/GetAllStock?
token=Po3bExGM8UmgfAgWaBcNxg&store=Product');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
جهت تست اتصال اولیه (نیاز به توکن ندارد).
/api/v1/GetTime
دریافت لیست انبارها و شناسه امن StorageGuid.
/api/v1/GetAllStorage
/api/v1/GetAllProduct?storageGuid=...
| پارامتر | نوع | توضیح |
|---|---|---|
storageGuid | Guid | اختیاری - فیلتر کالاها بر اساس انبار |
/api/v1/GetStock?productGuid=...&storageGuid=...
| پارامتر | نوع | الزامی | توضیح |
|---|---|---|---|
productGuid | Guid | بله | شناسه امن کالا |
storageGuid | Guid | خیر | شناسه انبار مشخص |
/api/v1/GetAllStock?storageGuid=...
| پارامتر | نوع | توضیح |
|---|---|---|
storageGuid | Guid | اختیاری - انبار خاص یا کل انبارها |
/api/v1/AddCustomer
ارسال اطلاعات به صورت JSON در Body (فیلد اجباری: Name)
/api/v1/AddForm
ارسال فاکتور/حواله انبار همراه با آرایهای از اقلام Items (شامل ProductGuid، Qty، Fee).