Smart Deal v2.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
The Smart Deal API is a REST API that's easy to query in any programming environment. The following is the full documentation for the REST API including schemas for the response and query objects as well as documentation for the REST endpoints. If you have any questions please chat with us at our Developer Forum or send us an email (api@practicalse.com).
Base URLs:
Authentication
- API Key (token)
- Parameter Name: X-Token, in: header.
Catalog
Everything about catalog sections and products
Get All Sections
Code samples
# You can also use wget
curl -X GET http://api.smartdeal.practicalse.com/rest/v2/catalog/sections.{format} \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
GET http://api.smartdeal.practicalse.com/rest/v2/catalog/sections.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Accept: application/json
var headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/catalog/sections.{format}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/catalog/sections.{format}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.get 'http://api.smartdeal.practicalse.com/rest/v2/catalog/sections.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.get('http://api.smartdeal.practicalse.com/rest/v2/catalog/sections.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/catalog/sections.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://api.smartdeal.practicalse.com/rest/v2/catalog/sections.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://api.smartdeal.practicalse.com/rest/v2/catalog/sections.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /catalog/sections.{format}
Get all sections list
This endpoint returns flat list of all public categories.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| lang | query | string | false | Language of text fields in response. (ISO 639-1) |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
| lang | en |
| lang | ru |
| lang | be |
Example responses
200 Response
[
{
"description": "string",
"parent": "string",
"title": "string",
"id": "string",
"count": 0
}
]
<?xml version="1.0" encoding="UTF-8" ?>
<Sections>
<description>string</description>
<parent>string</parent>
<title>string</title>
<id>string</id>
<count>0</count>
</Sections>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Sections |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Section Info
Code samples
# You can also use wget
curl -X GET http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}.{format} \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
GET http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Accept: application/json
var headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}.{format}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}.{format}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.get 'http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.get('http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /catalog/sections/{sectionId}.{format}
Information about section
This method returns list of subcategories by section ID. The fetch key for a section is its 'id'.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| sectionId | path | string | true | ID of section |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
{
"children": [
{
"description": "string",
"parent": "string",
"title": "string",
"id": "string",
"count": 0
}
]
}
<?xml version="1.0" encoding="UTF-8" ?>
<children>
<description>string</description>
<parent>string</parent>
<title>string</title>
<id>string</id>
<count>0</count>
</children>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Inline |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » children | [Section] | false | none | none |
| »» description | string | false | none | Text description of section |
| »» parent | string | false | none | Parent section ID |
| »» title | string | false | none | Title of the section |
| »» id | string | false | none | ID of the section |
| »» count | integer | false | none | Count of the products in the section |
Properties of section
Code samples
# You can also use wget
curl -X GET http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/props.{format} \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
GET http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/props.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Accept: application/json
var headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/props.{format}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/props.{format}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.get 'http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/props.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.get('http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/props.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/props.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/props.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/props.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /catalog/sections/{sectionId}/props.{format}
List of custom fields of the section
Describe filters for this section
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| sectionId | path | string | true | ID of section or "_" |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
[
{
"name": "string",
"title": "string",
"type": "string"
}
]
<?xml version="1.0" encoding="UTF-8" ?>
<SectionProps>
<name>string</name>
<title>string</title>
<type>string</type>
</SectionProps>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | SectionProps |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Path to section
Code samples
# You can also use wget
curl -X GET http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/path.{format} \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
GET http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/path.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Accept: application/json
var headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/path.{format}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/path.{format}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.get 'http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/path.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.get('http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/path.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/path.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/path.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://api.smartdeal.practicalse.com/rest/v2/catalog/sections/{sectionId}/path.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /catalog/sections/{sectionId}/path.{format}
Path to the section
List of sections
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| sectionId | path | string | true | ID of section |
| head | path | boolean | true | Include self |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
[
{
"name": "string",
"title": "string",
"type": "string"
}
]
<?xml version="1.0" encoding="UTF-8" ?>
<SectionProps>
<name>string</name>
<title>string</title>
<type>string</type>
</SectionProps>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | SectionProps |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Get Product
Code samples
# You can also use wget
curl -X GET http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}.{format} \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
GET http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Accept: application/json
var headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}.{format}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}.{format}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.get 'http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.get('http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /catalog/products/{productId}.{format}
Get product by id
This method returns individual product by ID. The fetch key for a part is its 'id'.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| productId | path | string | true | ID of the product |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
{
"catalog": "3987968",
"customFields": {
"Accessory Type": "Board Standoff",
"Categories": "Rack Accessories",
"Features": "0.650\" (17mm) Overall Height",
"For Use With/Related Products": "Enclosures",
"Lead Free Status / RoHS Status": "Copy",
"Manufacturer": "Hammond Manufacturing",
"Part Status": "Active",
"Series": "1421",
"suplierPartNumber": "HM1257-ND"
},
"dateCode": "15+",
"description": "Hammond Manufacturing",
"lastUpdate": 1234567890,
"manufacturer": "TI",
"partNumber": "Atmega-128",
"resources": [],
"id": "3987968",
"rohs": true
}
<?xml version="1.0" encoding="UTF-8" ?>
<Product>
<catalog>3987968</catalog>
<customFields>
<Accessory Type>Board Standoff</Accessory Type>
<Categories>Rack Accessories</Categories>
<Features>0.650" (17mm) Overall Height</Features>
<For Use With/Related Products>Enclosures</For Use With/Related Products>
<Lead Free Status / RoHS Status>Copy</Lead Free Status / RoHS Status>
<Manufacturer>Hammond Manufacturing</Manufacturer>
<Part Status>Active</Part Status>
<Series>1421</Series>
<suplierPartNumber>HM1257-ND</suplierPartNumber>
</customFields>
<dateCode>15+</dateCode>
<description>Hammond Manufacturing</description>
<lastUpdate>1234567890</lastUpdate>
<manufacturer>TI</manufacturer>
<partNumber>Atmega-128</partNumber>
<id>3987968</id>
<rohs>true</rohs>
</Product>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Product |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Get Analogs
Code samples
# You can also use wget
curl -X GET http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}/analogs.{format} \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
GET http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}/analogs.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Accept: application/json
var headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}/analogs.{format}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}/analogs.{format}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.get 'http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}/analogs.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.get('http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}/analogs.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}/analogs.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}/analogs.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://api.smartdeal.practicalse.com/rest/v2/catalog/products/{productId}/analogs.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /catalog/products/{productId}/analogs.{format}
Get analogs of product
This method returns analogs of the product. Result contains list of products with resources.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| productId | path | string | true | ID of the product |
| page | query | number | false | page |
| pp | query | number | false | items per page |
| min_score | query | number | false | limit of equals of custom fields (in %) |
| custom_field[{name}][value] | query | number | false | Rules for customField proce. Example: url?custom_field[A][value]=1&?custom_field[B][value]=0 |
| custom_field[{name}][weight] | query | number | false | Weight of filed. Example: url?custom_field[A][weight]=1&?custom_field[B][weight]=0 |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
[
{
"catalog": "3987968",
"customFields": {
"Accessory Type": "Board Standoff",
"Categories": "Rack Accessories",
"Features": "0.650\" (17mm) Overall Height",
"For Use With/Related Products": "Enclosures",
"Lead Free Status / RoHS Status": "Copy",
"Manufacturer": "Hammond Manufacturing",
"Part Status": "Active",
"Series": "1421",
"suplierPartNumber": "HM1257-ND"
},
"dateCode": "15+",
"description": "Hammond Manufacturing",
"lastUpdate": 1234567890,
"manufacturer": "TI",
"partNumber": "Atmega-128",
"resources": [],
"id": "3987968",
"rohs": true
}
]
<?xml version="1.0" encoding="UTF-8" ?>
<Products>
<catalog>3987968</catalog>
<customFields>
<Accessory Type>Board Standoff</Accessory Type>
<Categories>Rack Accessories</Categories>
<Features>0.650" (17mm) Overall Height</Features>
<For Use With/Related Products>Enclosures</For Use With/Related Products>
<Lead Free Status / RoHS Status>Copy</Lead Free Status / RoHS Status>
<Manufacturer>Hammond Manufacturing</Manufacturer>
<Part Status>Active</Part Status>
<Series>1421</Series>
<suplierPartNumber>HM1257-ND</suplierPartNumber>
</customFields>
<dateCode>15+</dateCode>
<description>Hammond Manufacturing</description>
<lastUpdate>1234567890</lastUpdate>
<manufacturer>TI</manufacturer>
<partNumber>Atmega-128</partNumber>
<id>3987968</id>
<rohs>true</rohs>
</Products>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Products |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | X-Counters-Total | integer | json | Totlay count of products. |
Get products list
Code samples
# You can also use wget
curl -X GET http://api.smartdeal.practicalse.com/rest/v2/catalog/products.{format} \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
GET http://api.smartdeal.practicalse.com/rest/v2/catalog/products.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Accept: application/json
var headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/catalog/products.{format}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/catalog/products.{format}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.get 'http://api.smartdeal.practicalse.com/rest/v2/catalog/products.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.get('http://api.smartdeal.practicalse.com/rest/v2/catalog/products.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/catalog/products.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://api.smartdeal.practicalse.com/rest/v2/catalog/products.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://api.smartdeal.practicalse.com/rest/v2/catalog/products.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /catalog/products.{format}
Get products list
This endpoint returns multiple products by request parameters. The uniqure key for each product is its 'id'. Missing products will also be missing from the response list.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| ids[] | query | string | false | list of product ID |
| page | query | integer | false | page |
| pp | query | integer | false | items per page |
| pns | query | string | false | part numbers |
| catalog | query | string | false | filter by catalog ID |
| query | query | string | false | Find product in catalog by query string |
| partNumber | query | string | false | filter by partNumber |
| dateCode | query | string | false | filter by dateCode |
| manufacturer | query | string | false | filter by manufacturer |
| custom_field[name] | query | string | false | filter by customField. Example: url?custom_field[name]=value |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
[
{
"catalog": "3987968",
"customFields": {
"Accessory Type": "Board Standoff",
"Categories": "Rack Accessories",
"Features": "0.650\" (17mm) Overall Height",
"For Use With/Related Products": "Enclosures",
"Lead Free Status / RoHS Status": "Copy",
"Manufacturer": "Hammond Manufacturing",
"Part Status": "Active",
"Series": "1421",
"suplierPartNumber": "HM1257-ND"
},
"dateCode": "15+",
"description": "Hammond Manufacturing",
"lastUpdate": 1234567890,
"manufacturer": "TI",
"partNumber": "Atmega-128",
"resources": [],
"id": "3987968",
"rohs": true
}
]
<?xml version="1.0" encoding="UTF-8" ?>
<Products>
<catalog>3987968</catalog>
<customFields>
<Accessory Type>Board Standoff</Accessory Type>
<Categories>Rack Accessories</Categories>
<Features>0.650" (17mm) Overall Height</Features>
<For Use With/Related Products>Enclosures</For Use With/Related Products>
<Lead Free Status / RoHS Status>Copy</Lead Free Status / RoHS Status>
<Manufacturer>Hammond Manufacturing</Manufacturer>
<Part Status>Active</Part Status>
<Series>1421</Series>
<suplierPartNumber>HM1257-ND</suplierPartNumber>
</customFields>
<dateCode>15+</dateCode>
<description>Hammond Manufacturing</description>
<lastUpdate>1234567890</lastUpdate>
<manufacturer>TI</manufacturer>
<partNumber>Atmega-128</partNumber>
<id>3987968</id>
<rohs>true</rohs>
</Products>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Products |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | X-Counters-Total | integer | json | Totlay count of products. |
Get resources list
Code samples
# You can also use wget
curl -X GET http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format} \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
GET http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Accept: application/json
var headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.get 'http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.get('http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /catalog/resources.{format}
Get resources
Get resources list
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| ids[] | query | string | false | id of resource |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
[
{
"comments": [
"string"
],
"date": 0,
"mime": "string",
"source": "string",
"tags": {},
"title": "string",
"id": "string"
}
]
<?xml version="1.0" encoding="UTF-8" ?>
<Resources>
<comments>string</comments>
<date>0</date>
<mime>string</mime>
<source>string</source>
<tags/>
<title>string</title>
<id>string</id>
</Resources>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Resources |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Create catalog resource from file
Code samples
# You can also use wget
curl -X POST http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format} \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
POST http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Content-Type: application/x-www-form-urlencoded
Accept: application/json
var headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format}',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '{
"file": "string"
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format}',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.post 'http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.post('http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/x-www-form-urlencoded"},
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/x-www-form-urlencoded',
'Accept' => 'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://api.smartdeal.practicalse.com/rest/v2/catalog/resources.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
POST /catalog/resources.{format}
Create catalog resource from file
Send single file for create resource.
Body parameter
file: string
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| tags[key] | query | string | false | custom tags for response |
| public | query | boolean | false | share resource for public catalog |
| body | body | object | false | none |
| » file | body | string(binary) | true | The file to upload. |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
{
"comments": [
"string"
],
"date": 0,
"mime": "string",
"source": "string",
"tags": {},
"title": "string",
"id": "string"
}
<?xml version="1.0" encoding="UTF-8" ?>
<Resource>
<comments>string</comments>
<date>0</date>
<mime>string</mime>
<source>string</source>
<tags/>
<title>string</title>
<id>string</id>
</Resource>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Resource |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Lots
Everything about lots and positions
Get lots
Code samples
# You can also use wget
curl -X GET http://api.smartdeal.practicalse.com/rest/v2/lots.{format} \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
GET http://api.smartdeal.practicalse.com/rest/v2/lots.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Accept: application/json
var headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/lots.{format}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/lots.{format}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.get 'http://api.smartdeal.practicalse.com/rest/v2/lots.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.get('http://api.smartdeal.practicalse.com/rest/v2/lots.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/lots.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://api.smartdeal.practicalse.com/rest/v2/lots.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://api.smartdeal.practicalse.com/rest/v2/lots.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /lots.{format}
Get lots of current user
List of lots
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| status | query | string | false | status of stock |
| page | query | number | false | pattern for product pn |
| pp | query | number | false | items per page |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
[
{
"advanced": {
"currency": "USD",
"durationDays": 0,
"minimalRating": 0,
"project": null,
"startDate": 0
},
"uDate": 0,
"cDate": 0,
"owner": "string",
"status": "open",
"type": "string",
"id": "string",
"positions": [
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"lot": "string",
"type": "lot",
"product": "string",
"quantity": 0,
"status": "open",
"uDate": 0,
"cDate": 0,
"units": "string",
"id": "string"
}
]
}
]
<?xml version="1.0" encoding="UTF-8" ?>
<Lots>
<advanced>
<currency>USD</currency>
<durationDays>0</durationDays>
<minimalRating>0</minimalRating>
<project/>
<startDate>0</startDate>
</advanced>
<uDate>0</uDate>
<cDate>0</cDate>
<owner>string</owner>
<status>open</status>
<type>string</type>
<id>string</id>
<positions>
<advanced>
<description>string</description>
<condition>string</condition>
<dateCode>string</dateCode>
<leadTime>0</leadTime>
<manufacturer>string</manufacturer>
<minCount>0</minCount>
<partNumber>string</partNumber>
</advanced>
<prices>
<price>0</price>
<quota>0</quota>
</prices>
<lot>string</lot>
<type>lot</type>
<product>string</product>
<quantity>0</quantity>
<status>open</status>
<uDate>0</uDate>
<cDate>0</cDate>
<units>string</units>
<id>string</id>
</positions>
</Lots>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Lots |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | X-Counters-Total | integer | json | Totlay count of products. |
Create new lot
Code samples
# You can also use wget
curl -X POST http://api.smartdeal.practicalse.com/rest/v2/lots.{format} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
POST http://api.smartdeal.practicalse.com/rest/v2/lots.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/lots.{format}',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '{
"advanced": {
"currency": "USD",
"durationDays": 0,
"minimalRating": 0,
"startDate": 0
},
"status": "open",
"positions": [
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"product": "string",
"quantity": 0,
"status": "open",
"units": "string"
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/lots.{format}',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.post 'http://api.smartdeal.practicalse.com/rest/v2/lots.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.post('http://api.smartdeal.practicalse.com/rest/v2/lots.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/lots.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://api.smartdeal.practicalse.com/rest/v2/lots.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'Accept' => 'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://api.smartdeal.practicalse.com/rest/v2/lots.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
POST /lots.{format}
Create new lot
Create new lot with positions list.
Body parameter
{
"advanced": {
"currency": "USD",
"durationDays": 0,
"minimalRating": 0,
"startDate": 0
},
"status": "open",
"positions": [
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"product": "string",
"quantity": 0,
"status": "open",
"units": "string"
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| body | body | Lot | true | none |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
{
"advanced": {
"currency": "USD",
"durationDays": 0,
"minimalRating": 0,
"project": null,
"startDate": 0
},
"uDate": 0,
"cDate": 0,
"owner": "string",
"status": "open",
"type": "string",
"id": "string",
"positions": [
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"lot": "string",
"type": "lot",
"product": "string",
"quantity": 0,
"status": "open",
"uDate": 0,
"cDate": 0,
"units": "string",
"id": "string"
}
]
}
<?xml version="1.0" encoding="UTF-8" ?>
<Lot>
<advanced>
<currency>USD</currency>
<durationDays>0</durationDays>
<minimalRating>0</minimalRating>
<project/>
<startDate>0</startDate>
</advanced>
<uDate>0</uDate>
<cDate>0</cDate>
<owner>string</owner>
<status>open</status>
<type>string</type>
<id>string</id>
<positions>
<advanced>
<description>string</description>
<condition>string</condition>
<dateCode>string</dateCode>
<leadTime>0</leadTime>
<manufacturer>string</manufacturer>
<minCount>0</minCount>
<partNumber>string</partNumber>
</advanced>
<prices>
<price>0</price>
<quota>0</quota>
</prices>
<lot>string</lot>
<type>lot</type>
<product>string</product>
<quantity>0</quantity>
<status>open</status>
<uDate>0</uDate>
<cDate>0</cDate>
<units>string</units>
<id>string</id>
</positions>
</Lot>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Lot |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Stocks
Everything about stocks and positions
Get stocks
Code samples
# You can also use wget
curl -X GET http://api.smartdeal.practicalse.com/rest/v2/stocks.{format} \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
GET http://api.smartdeal.practicalse.com/rest/v2/stocks.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Accept: application/json
var headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/stocks.{format}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/stocks.{format}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.get 'http://api.smartdeal.practicalse.com/rest/v2/stocks.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.get('http://api.smartdeal.practicalse.com/rest/v2/stocks.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/stocks.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://api.smartdeal.practicalse.com/rest/v2/stocks.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://api.smartdeal.practicalse.com/rest/v2/stocks.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /stocks.{format}
Get stocks of current user
List of stocks
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| status | query | string | false | status of stock |
| page | query | number | false | page |
| pp | query | number | false | items per page |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
[
{
"advanced": {
"currency": "string",
"durationDays": 0,
"minimalRating": 0,
"project": null,
"startDate": 0
},
"cDate": 0,
"owner": "string",
"status": "string",
"type": "string",
"uDate": 0,
"id": "string",
"positions": [
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"lot": "string",
"type": "lot",
"product": "string",
"quantity": 0,
"status": "open",
"uDate": 0,
"cDate": 0,
"units": "string",
"id": "string"
}
]
}
]
<?xml version="1.0" encoding="UTF-8" ?>
<Stocks>
<advanced>
<currency>string</currency>
<durationDays>0</durationDays>
<minimalRating>0</minimalRating>
<project/>
<startDate>0</startDate>
</advanced>
<cDate>0</cDate>
<owner>string</owner>
<status>string</status>
<type>string</type>
<uDate>0</uDate>
<id>string</id>
<positions>
<advanced>
<description>string</description>
<condition>string</condition>
<dateCode>string</dateCode>
<leadTime>0</leadTime>
<manufacturer>string</manufacturer>
<minCount>0</minCount>
<partNumber>string</partNumber>
</advanced>
<prices>
<price>0</price>
<quota>0</quota>
</prices>
<lot>string</lot>
<type>lot</type>
<product>string</product>
<quantity>0</quantity>
<status>open</status>
<uDate>0</uDate>
<cDate>0</cDate>
<units>string</units>
<id>string</id>
</positions>
</Stocks>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Stocks |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | X-Counters-Total | integer | json | Totlay count of products. |
Create new stock
Code samples
# You can also use wget
curl -X POST http://api.smartdeal.practicalse.com/rest/v2/stocks.{format} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
POST http://api.smartdeal.practicalse.com/rest/v2/stocks.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/stocks.{format}',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '{
"advanced": {
"currency": "string",
"durationDays": 0,
"minimalRating": 0,
"project": null,
"startDate": 0
},
"status": "string",
"positions": [
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"product": "string",
"quantity": 0,
"status": "open",
"units": "string"
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/stocks.{format}',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.post 'http://api.smartdeal.practicalse.com/rest/v2/stocks.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.post('http://api.smartdeal.practicalse.com/rest/v2/stocks.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/stocks.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://api.smartdeal.practicalse.com/rest/v2/stocks.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'Accept' => 'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://api.smartdeal.practicalse.com/rest/v2/stocks.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
POST /stocks.{format}
Create new stock
Create new stock with positions list.
Body parameter
{
"advanced": {
"currency": "string",
"durationDays": 0,
"minimalRating": 0,
"project": null,
"startDate": 0
},
"status": "string",
"positions": [
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"product": "string",
"quantity": 0,
"status": "open",
"units": "string"
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| body | body | Stock | true | none |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
{
"advanced": {
"currency": "string",
"durationDays": 0,
"minimalRating": 0,
"project": null,
"startDate": 0
},
"cDate": 0,
"owner": "string",
"status": "string",
"type": "string",
"uDate": 0,
"id": "string",
"positions": [
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"lot": "string",
"type": "lot",
"product": "string",
"quantity": 0,
"status": "open",
"uDate": 0,
"cDate": 0,
"units": "string",
"id": "string"
}
]
}
<?xml version="1.0" encoding="UTF-8" ?>
<Stock>
<advanced>
<currency>string</currency>
<durationDays>0</durationDays>
<minimalRating>0</minimalRating>
<project/>
<startDate>0</startDate>
</advanced>
<cDate>0</cDate>
<owner>string</owner>
<status>string</status>
<type>string</type>
<uDate>0</uDate>
<id>string</id>
<positions>
<advanced>
<description>string</description>
<condition>string</condition>
<dateCode>string</dateCode>
<leadTime>0</leadTime>
<manufacturer>string</manufacturer>
<minCount>0</minCount>
<partNumber>string</partNumber>
</advanced>
<prices>
<price>0</price>
<quota>0</quota>
</prices>
<lot>string</lot>
<type>lot</type>
<product>string</product>
<quantity>0</quantity>
<status>open</status>
<uDate>0</uDate>
<cDate>0</cDate>
<units>string</units>
<id>string</id>
</positions>
</Stock>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Stock |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Get positions of stock
Code samples
# You can also use wget
curl -X GET http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format} \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
GET http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Accept: application/json
var headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.get 'http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.get('http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /stocks/{stockid}/positions.{format}
Get positions of the stock
List of positions
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| stockid | path | string | true | ID of the stock or "_" for ignore filter by stockid. |
| product[partNumber] | query | string | false | Find positions with same part numbers in the stock |
| product[dataCode] | query | string | false | Find positions with same data code in the stock |
| product[manufacturer] | query | string | false | Find positions with same manufacturer in the stock |
| query | query | string | false | Find request for products in the stock |
| page | query | number | false | pattern for product pn |
| merge | query | boolean | false | merge positions by productId. if local param passed also, then result include resources |
| user | query | string | false | user id |
| status | query | string | false | status of position |
| local | query | boolean | false | local stocks |
| pp | query | number | false | items per page |
| products[] | query | string | false | product ids |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
[
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"lot": "string",
"type": "lot",
"product": "string",
"quantity": 0,
"status": "open",
"uDate": 0,
"cDate": 0,
"units": "string",
"id": "string"
}
]
<?xml version="1.0" encoding="UTF-8" ?>
<Positions>
<advanced>
<description>string</description>
<condition>string</condition>
<dateCode>string</dateCode>
<leadTime>0</leadTime>
<manufacturer>string</manufacturer>
<minCount>0</minCount>
<partNumber>string</partNumber>
</advanced>
<prices>
<price>0</price>
<quota>0</quota>
</prices>
<lot>string</lot>
<type>lot</type>
<product>string</product>
<quantity>0</quantity>
<status>open</status>
<uDate>0</uDate>
<cDate>0</cDate>
<units>string</units>
<id>string</id>
</Positions>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Positions |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | X-Counters-Total | integer | json | Totlay count of products. |
Update positions by stock
Code samples
# You can also use wget
curl -X PATCH http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
PATCH http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}',
method: 'patch',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '[
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"product": "string",
"quantity": 0,
"status": "open",
"units": "string"
}
]';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.patch 'http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.patch('http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'Accept' => 'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
PATCH /stocks/{stockid}/positions.{format}
Update positions of the stock
Positions
Body parameter
[
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"product": "string",
"quantity": 0,
"status": "open",
"units": "string"
}
]
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| stockid | path | string | true | ID of stock |
| body | body | Positions | true | none |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
[
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"lot": "string",
"type": "lot",
"product": "string",
"quantity": 0,
"status": "open",
"uDate": 0,
"cDate": 0,
"units": "string",
"id": "string"
}
]
<?xml version="1.0" encoding="UTF-8" ?>
<Positions>
<advanced>
<description>string</description>
<condition>string</condition>
<dateCode>string</dateCode>
<leadTime>0</leadTime>
<manufacturer>string</manufacturer>
<minCount>0</minCount>
<partNumber>string</partNumber>
</advanced>
<prices>
<price>0</price>
<quota>0</quota>
</prices>
<lot>string</lot>
<type>lot</type>
<product>string</product>
<quantity>0</quantity>
<status>open</status>
<uDate>0</uDate>
<cDate>0</cDate>
<units>string</units>
<id>string</id>
</Positions>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Positions |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Create positions in stock
Code samples
# You can also use wget
curl -X POST http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
POST http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '[
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"product": "string",
"quantity": 0,
"status": "open",
"units": "string"
}
]';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.post 'http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.post('http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'Accept' => 'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
POST /stocks/{stockid}/positions.{format}
Create positions in stock
Positions
Body parameter
[
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"product": "string",
"quantity": 0,
"status": "open",
"units": "string"
}
]
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| stockid | path | string | true | ID of stock |
| body | body | Positions | true | none |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
[
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"lot": "string",
"type": "lot",
"product": "string",
"quantity": 0,
"status": "open",
"uDate": 0,
"cDate": 0,
"units": "string",
"id": "string"
}
]
<?xml version="1.0" encoding="UTF-8" ?>
<Positions>
<advanced>
<description>string</description>
<condition>string</condition>
<dateCode>string</dateCode>
<leadTime>0</leadTime>
<manufacturer>string</manufacturer>
<minCount>0</minCount>
<partNumber>string</partNumber>
</advanced>
<prices>
<price>0</price>
<quota>0</quota>
</prices>
<lot>string</lot>
<type>lot</type>
<product>string</product>
<quantity>0</quantity>
<status>open</status>
<uDate>0</uDate>
<cDate>0</cDate>
<units>string</units>
<id>string</id>
</Positions>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Positions |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Get position
Code samples
# You can also use wget
curl -X GET http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format} \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
GET http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Accept: application/json
var headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.get 'http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.get('http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /stocks/{stockid}/positions/{id}.{format}
Get details of position
Get details of position
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| stockid | path | string | true | ID of stock |
| id | path | string | true | id of position |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"lot": "string",
"type": "lot",
"product": "string",
"quantity": 0,
"status": "open",
"uDate": 0,
"cDate": 0,
"units": "string",
"id": "string"
}
<?xml version="1.0" encoding="UTF-8" ?>
<Position>
<advanced>
<description>string</description>
<condition>string</condition>
<dateCode>string</dateCode>
<leadTime>0</leadTime>
<manufacturer>string</manufacturer>
<minCount>0</minCount>
<partNumber>string</partNumber>
</advanced>
<prices>
<price>0</price>
<quota>0</quota>
</prices>
<lot>string</lot>
<type>lot</type>
<product>string</product>
<quantity>0</quantity>
<status>open</status>
<uDate>0</uDate>
<cDate>0</cDate>
<units>string</units>
<id>string</id>
</Position>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Position |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Update single position of stock
Code samples
# You can also use wget
curl -X PATCH http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
PATCH http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}',
method: 'patch',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"product": "string",
"quantity": 0,
"status": "open",
"units": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.patch 'http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.patch('http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'Accept' => 'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
PATCH /stocks/{stockid}/positions/{id}.{format}
Update single position
Change any information about position
Body parameter
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"product": "string",
"quantity": 0,
"status": "open",
"units": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| stockId | path | string | true | ID of stock |
| positionId | path | string | true | id of position |
| body | body | Position | true | none |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"lot": "string",
"type": "lot",
"product": "string",
"quantity": 0,
"status": "open",
"uDate": 0,
"cDate": 0,
"units": "string",
"id": "string"
}
<?xml version="1.0" encoding="UTF-8" ?>
<Position>
<advanced>
<description>string</description>
<condition>string</condition>
<dateCode>string</dateCode>
<leadTime>0</leadTime>
<manufacturer>string</manufacturer>
<minCount>0</minCount>
<partNumber>string</partNumber>
</advanced>
<prices>
<price>0</price>
<quota>0</quota>
</prices>
<lot>string</lot>
<type>lot</type>
<product>string</product>
<quantity>0</quantity>
<status>open</status>
<uDate>0</uDate>
<cDate>0</cDate>
<units>string</units>
<id>string</id>
</Position>
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Position |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Close position of stock
Code samples
# You can also use wget
curl -X DELETE http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format} \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
DELETE http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Accept: application/json
var headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}',
method: 'delete',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.delete 'http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.delete('http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','http://api.smartdeal.practicalse.com/rest/v2/stocks/{stockid}/positions/{id}.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
DELETE /stocks/{stockid}/positions/{id}.{format}
Close position of stock
Change status of position to close
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| stockid | path | string | true | ID of stock |
| id | path | string | true | id of position |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
Example responses
200 Response
true
400 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | boolean |
| 400 | Bad Request | Bad request | Error |
| 403 | Forbidden | API key is missing or invalid | Error |
| 500 | Internal Server Error | Server error | Error |
Users
Update account profile
Code samples
# You can also use wget
curl -X PATCH http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}/profile.{format} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
PATCH http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}/profile.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}/profile.{format}',
method: 'patch',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '{
"firstname": "string",
"lastname": "string",
"language": "string",
"picture": "string",
"phones": [
"string"
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}/profile.{format}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.patch 'http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}/profile.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.patch('http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}/profile.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}/profile.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}/profile.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'Accept' => 'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}/profile.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
PATCH /users/{strategy}/profile.{format}
Update account profile
Update addition profile information
Body parameter
{
"firstname": "string",
"lastname": "string",
"language": "string",
"picture": "string",
"phones": [
"string"
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| strategy | path | string | true | Strategy |
| body | body | Update_account_profileBody | true | none |
| » firstname | body | string | false | none |
| » lastname | body | string | false | none |
| » language | body | string | false | none |
| » picture | body | string | false | none |
| » phones | body | [string] | false | none |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
| strategy | json |
| strategy | xml |
Example responses
200 Response
{
"firstname": "string",
"lastname": "string",
"language": "string",
"picture": "string",
"phones": [
"string"
]
}
<?xml version="1.0" encoding="UTF-8" ?>
<firstname>string</firstname>
<lastname>string</lastname>
<language>string</language>
<picture>string</picture>
<phones>string</phones>
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Inline |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » firstname | string | false | none | none |
| » lastname | string | false | none | none |
| » language | string | false | none | none |
| » picture | string | false | none | none |
| » phones | [string] | false | none | none |
Signin
Code samples
# You can also use wget
curl -X PUT http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
PUT http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format}',
method: 'put',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '{
"login": "user@example.com",
"password": "pa$$word"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.put 'http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.put('http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
PUT /users/{strategy}.{format}
Signin
Auth with credentials
Body parameter
{
"login": "user@example.com",
"password": "pa$$word"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| strategy | path | string | true | Response format |
| body | body | Credentials | true | none |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
| strategy | json |
| strategy | xml |
Example responses
200 Response
{
"account": "string",
"user": "string"
}
<?xml version="1.0" encoding="UTF-8" ?>
<account>string</account>
<user>string</user>
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Inline |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » account | string | false | none | account id |
| » user | string | false | none | user id |
Signup
Code samples
# You can also use wget
curl -X POST http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format}',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '{
"login": "user@example.com",
"password": "pa$$word"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format}',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://api.smartdeal.practicalse.com/rest/v2/users/{strategy}.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
POST /users/{strategy}.{format}
Signup
Create new user and account
Body parameter
{
"login": "user@example.com",
"password": "pa$$word"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| strategy | path | string | true | Response format |
| body | body | Credentials | true | none |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
| strategy | json |
| strategy | xml |
Example responses
200 Response
{
"id": 0,
"name": "string"
}
<?xml version="1.0" encoding="UTF-8" ?>
<User>
<id>0</id>
<name>string</name>
</User>
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | User |
Get Token
Code samples
# You can also use wget
curl -X POST http://api.smartdeal.practicalse.com/rest/v2/users/token/{strategy}.{format} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST http://api.smartdeal.practicalse.com/rest/v2/users/token/{strategy}.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/users/token/{strategy}.{format}',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '{
"login": "user@example.com",
"password": "pa$$word"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/users/token/{strategy}.{format}',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'http://api.smartdeal.practicalse.com/rest/v2/users/token/{strategy}.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('http://api.smartdeal.practicalse.com/rest/v2/users/token/{strategy}.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/users/token/{strategy}.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://api.smartdeal.practicalse.com/rest/v2/users/token/{strategy}.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://api.smartdeal.practicalse.com/rest/v2/users/token/{strategy}.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
POST /users/token/{strategy}.{format}
Get Token
Auth with credentials
Body parameter
{
"login": "user@example.com",
"password": "pa$$word"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| strategy | path | string | true | Auth strategy |
| body | body | Credentials | true | none |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
| strategy |
Example responses
200 Response
{
"token": "string",
"account": "string",
"user": "string"
}
<?xml version="1.0" encoding="UTF-8" ?>
<token>string</token>
<account>string</account>
<user>string</user>
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Inline |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » token | string | false | none | token value |
| » account | string | false | none | account id |
| » user | string | false | none | user id |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | X-Account-Id | string | id of account | |
| 200 | X-User-Id | string | id of user |
Update user profile
Code samples
# You can also use wget
curl -X PATCH http://api.smartdeal.practicalse.com/rest/v2/users/profile.{format} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Token: API_KEY'
PATCH http://api.smartdeal.practicalse.com/rest/v2/users/profile.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/users/profile.{format}',
method: 'patch',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const inputBody = '{
"firstname": "string",
"lastname": "string",
"language": "string",
"picture": "string",
"phones": [
"string"
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/users/profile.{format}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Token' => 'API_KEY'
}
result = RestClient.patch 'http://api.smartdeal.practicalse.com/rest/v2/users/profile.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Token': 'API_KEY'
}
r = requests.patch('http://api.smartdeal.practicalse.com/rest/v2/users/profile.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/users/profile.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "http://api.smartdeal.practicalse.com/rest/v2/users/profile.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'application/json',
'Accept' => 'application/json',
'X-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','http://api.smartdeal.practicalse.com/rest/v2/users/profile.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
PATCH /users/profile.{format}
Update current profile
Update profile information of current user
Body parameter
{
"firstname": "string",
"lastname": "string",
"language": "string",
"picture": "string",
"phones": [
"string"
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Response format |
| strategy | path | string | true | Strategy |
| body | body | Update_account_profileBody | true | none |
| » firstname | body | string | false | none |
| » lastname | body | string | false | none |
| » language | body | string | false | none |
| » picture | body | string | false | none |
| » phones | body | [string] | false | none |
Enumerated Values
| Parameter | Value |
|---|---|
| format | json |
| format | xml |
| strategy |
Example responses
200 Response
{
"firstname": "string",
"lastname": "string",
"language": "string",
"picture": "string",
"phones": [
"string"
]
}
<?xml version="1.0" encoding="UTF-8" ?>
<firstname>string</firstname>
<lastname>string</lastname>
<language>string</language>
<picture>string</picture>
<phones>string</phones>
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | Inline |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » firstname | string | false | none | none |
| » lastname | string | false | none | none |
| » language | string | false | none | none |
| » picture | string | false | none | none |
| » phones | [string] | false | none | none |
Media
Get media resource
Code samples
# You can also use wget
curl -X GET http://api.smartdeal.practicalse.com/rest/v2/media/{hash}.{format} \
-H 'X-Token: API_KEY'
GET http://api.smartdeal.practicalse.com/rest/v2/media/{hash}.{format} HTTP/1.1
Host: api.smartdeal.practicalse.com
var headers = {
'X-Token':'API_KEY'
};
$.ajax({
url: 'http://api.smartdeal.practicalse.com/rest/v2/media/{hash}.{format}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const fetch = require('node-fetch');
const headers = {
'X-Token':'API_KEY'
};
fetch('http://api.smartdeal.practicalse.com/rest/v2/media/{hash}.{format}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'X-Token' => 'API_KEY'
}
result = RestClient.get 'http://api.smartdeal.practicalse.com/rest/v2/media/{hash}.{format}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'X-Token': 'API_KEY'
}
r = requests.get('http://api.smartdeal.practicalse.com/rest/v2/media/{hash}.{format}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http://api.smartdeal.practicalse.com/rest/v2/media/{hash}.{format}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"X-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://api.smartdeal.practicalse.com/rest/v2/media/{hash}.{format}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://api.smartdeal.practicalse.com/rest/v2/media/{hash}.{format}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
GET /media/{hash}.{format}
Getting media resource
Get loaded resource. Path must starts after domain name. Example: api.example.com/media/get/id.jpg
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| format | path | string | true | Format of resource |
| id | path | string | true | Identificator of resource |
Enumerated Values
| Parameter | Value |
|---|---|
| format | jpg |
| format |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | ok | None |
Schemas
Price
{
"price": 0,
"quota": 0
}
Mapping currencies to lists of (Break, Price) tuples
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| price | number | true | none | none |
| quota | integer | true | none | none |
Product
{
"catalog": "3987968",
"customFields": {
"Accessory Type": "Board Standoff",
"Categories": "Rack Accessories",
"Features": "0.650\" (17mm) Overall Height",
"For Use With/Related Products": "Enclosures",
"Lead Free Status / RoHS Status": "Copy",
"Manufacturer": "Hammond Manufacturing",
"Part Status": "Active",
"Series": "1421",
"suplierPartNumber": "HM1257-ND"
},
"dateCode": "15+",
"description": "Hammond Manufacturing",
"lastUpdate": 1234567890,
"manufacturer": "TI",
"partNumber": "Atmega-128",
"resources": [],
"id": "3987968",
"rohs": true
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| catalog | string | false | none | ID of section |
| customFields | object | false | none | Values of custom fields |
| dateCode | string | false | none | Date code of product |
| description | string | false | none | Text description of product |
| lastUpdate | integer | false | none | Timestamp of last information change |
| manufacturer | string | false | none | Title of the manufacturer |
| partNumber | string | false | none | The manufacturer part number |
| resources | [Resource] | false | none | List of resources bounded with this product |
| id | string | false | none | ID of the product |
| rohs | boolean | false | none | RoHS status |
Resource
{
"comments": [
"string"
],
"date": 0,
"mime": "string",
"source": "string",
"tags": {},
"title": "string",
"id": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| comments | [string] | false | none | none |
| date | integer | false | none | Unix time |
| mime | string | false | none | none |
| source | string | false | none | none |
| tags | object | false | none | none |
| title | string | false | none | none |
| id | string | false | read-only | none |
Section
{
"description": "string",
"parent": "string",
"title": "string",
"id": "string",
"count": 0
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| description | string | false | none | Text description of section |
| parent | string | false | none | Parent section ID |
| title | string | false | none | Title of the section |
| id | string | false | none | ID of the section |
| count | integer | false | none | Count of the products in the section |
Lot
{
"advanced": {
"currency": "USD",
"durationDays": 0,
"minimalRating": 0,
"project": null,
"startDate": 0
},
"uDate": 0,
"cDate": 0,
"owner": "string",
"status": "open",
"type": "string",
"id": "string",
"positions": [
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"lot": "string",
"type": "lot",
"product": "string",
"quantity": 0,
"status": "open",
"uDate": 0,
"cDate": 0,
"units": "string",
"id": "string"
}
]
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| advanced | object | true | none | none |
| » currency | string | true | none | Currency |
| » durationDays | integer | true | none | none |
| » minimalRating | integer | true | none | none |
| » project | string|null | true | read-only | Link to project from profile |
| » startDate | integer | true | none | none |
| uDate | integer | true | read-only | Date of last update |
| cDate | integer | true | read-only | Date of last update |
| owner | string | true | read-only | none |
| status | string | true | none | Status of position |
| type | string | true | read-only | none |
| id | string | true | read-only | none |
| positions | Positions | true | none | none |
Enumerated Values
| Property | Value |
|---|---|
| currency | USD |
| currency | BYN |
| currency | RUB |
| currency | EUR |
| status | open |
| status | closed |
Stock
{
"advanced": {
"currency": "string",
"durationDays": 0,
"minimalRating": 0,
"project": null,
"startDate": 0
},
"cDate": 0,
"owner": "string",
"status": "string",
"type": "string",
"uDate": 0,
"id": "string",
"positions": [
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"lot": "string",
"type": "lot",
"product": "string",
"quantity": 0,
"status": "open",
"uDate": 0,
"cDate": 0,
"units": "string",
"id": "string"
}
]
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| advanced | object | true | none | none |
| » currency | string | true | none | none |
| » durationDays | integer | true | none | none |
| » minimalRating | integer | true | none | none |
| » project | any | true | none | none |
| » startDate | integer | true | none | none |
| cDate | integer | true | read-only | none |
| owner | string | true | read-only | none |
| status | string | true | none | none |
| type | string | true | read-only | none |
| uDate | integer | true | read-only | none |
| id | string | true | read-only | none |
| positions | [Position] | true | none | none |
Position
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"lot": "string",
"type": "lot",
"product": "string",
"quantity": 0,
"status": "open",
"uDate": 0,
"cDate": 0,
"units": "string",
"id": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| advanced | object | true | none | none |
| » description | string | true | none | Description text value |
| » condition | string | false | none | none |
| » dateCode | string | true | none | Date code of product |
| » leadTime | integer | true | none | Number of days to acquire parts from factory |
| » manufacturer | string | true | none | Title of the manufacturer |
| » minCount | integer | true | none | none |
| » partNumber | string | true | none | The manufacturer part number |
| prices | Prices | true | none | Dictionary mapping currencies to lists of (Break, Price) tuples |
| lot | string | true | read-only | Link to super object (Lot or stock) |
| type | string | true | read-only | Lot or Stock |
| product | string | false | none | Product link |
| quantity | integer | true | none | Quantity of position |
| status | string | true | none | Status of position |
| uDate | integer | true | read-only | Date of last update |
| cDate | integer | true | read-only | Date of last update |
| units | string | true | none | Units of position |
| id | string | true | read-only | Unique identifier |
Enumerated Values
| Property | Value |
|---|---|
| type | lot |
| type | stock |
| status | open |
| status | closed |
SectionProp
{
"name": "string",
"title": "string",
"type": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | true | none | none |
| title | string | true | none | none |
| type | string | true | none | none |
ReportPosition
{
"position": "string",
"lotPosition": "string",
"robot": "string",
"date": 0
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| position | string | true | none | none |
| lotPosition | string | true | none | none |
| robot | string | true | none | none |
| date | integer | true | none | none |
Error
{
"code": "04-400-1",
"message": "ValidationError: child \"password\" fails because [\"password\" length must be at least 8 characters long]"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| code | string | true | none | Error codes |
| message | string | true | none | Text data about error |
Enumerated Values
| Property | Value |
|---|---|
| code | 04-400-N |
| code | 04-403-N |
| code | 04-500-N |
Prices
[
{
"price": 0,
"quota": 0
}
]
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [Price] | false | none | [Mapping currencies to lists of (Break, Price) tuples] |
SectionProps
[
{
"name": "string",
"title": "string",
"type": "string"
}
]
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [SectionProp] | false | none | none |
Sections
[
{
"description": "string",
"parent": "string",
"title": "string",
"id": "string",
"count": 0
}
]
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [Section] | false | none | none |
Products
[
{
"catalog": "3987968",
"customFields": {
"Accessory Type": "Board Standoff",
"Categories": "Rack Accessories",
"Features": "0.650\" (17mm) Overall Height",
"For Use With/Related Products": "Enclosures",
"Lead Free Status / RoHS Status": "Copy",
"Manufacturer": "Hammond Manufacturing",
"Part Status": "Active",
"Series": "1421",
"suplierPartNumber": "HM1257-ND"
},
"dateCode": "15+",
"description": "Hammond Manufacturing",
"lastUpdate": 1234567890,
"manufacturer": "TI",
"partNumber": "Atmega-128",
"resources": [],
"id": "3987968",
"rohs": true
}
]
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [Product] | false | none | none |
Positions
[
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"lot": "string",
"type": "lot",
"product": "string",
"quantity": 0,
"status": "open",
"uDate": 0,
"cDate": 0,
"units": "string",
"id": "string"
}
]
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [Position] | false | none | none |
Resources
[
{
"comments": [
"string"
],
"date": 0,
"mime": "string",
"source": "string",
"tags": {},
"title": "string",
"id": "string"
}
]
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [Resource] | false | none | none |
Lots
[
{
"advanced": {
"currency": "USD",
"durationDays": 0,
"minimalRating": 0,
"project": null,
"startDate": 0
},
"uDate": 0,
"cDate": 0,
"owner": "string",
"status": "open",
"type": "string",
"id": "string",
"positions": [
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"lot": "string",
"type": "lot",
"product": "string",
"quantity": 0,
"status": "open",
"uDate": 0,
"cDate": 0,
"units": "string",
"id": "string"
}
]
}
]
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [Lot] | false | none | none |
Stocks
[
{
"advanced": {
"currency": "string",
"durationDays": 0,
"minimalRating": 0,
"project": null,
"startDate": 0
},
"cDate": 0,
"owner": "string",
"status": "string",
"type": "string",
"uDate": 0,
"id": "string",
"positions": [
{
"advanced": {
"description": "string",
"condition": "string",
"dateCode": "string",
"leadTime": 0,
"manufacturer": "string",
"minCount": 0,
"partNumber": "string"
},
"prices": [
{
"price": 0,
"quota": 0
}
],
"lot": "string",
"type": "lot",
"product": "string",
"quantity": 0,
"status": "open",
"uDate": 0,
"cDate": 0,
"units": "string",
"id": "string"
}
]
}
]
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [Stock] | false | none | none |
ReportPositions
[
{
"position": "string",
"lotPosition": "string",
"robot": "string",
"date": 0
}
]
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [ReportPosition] | false | none | none |
User
{
"id": 0,
"name": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | integer | true | none | none |
| name | string | true | none | none |
Credentials
{
"login": "user@example.com",
"password": "pa$$word"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| login | string(email) | true | none | none |
| password | string(password) | true | none | none |