Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/OTapi/ drwxr-xr-x | |
| Viewing file: Select action/file-type: process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
const axios = require('axios');
const crypto = require('crypto');
const OT_KEY = process.env.INSTANCE_KEY || 'your_ot_key';
const OT_SECRET = process.env.SECRET || 'your_ot_secret';
const OT_LANG = process.env.OT_LANG || ''; // Default empty if not specified
const method = 'BatchSearchItemsFrame';
const serviceUrl = `https://otapi.net/service-json/BatchSearchItemsFrame`;
const payload = {
FramePosition: 0,
FrameSize: 50,
BlockList: {
Brand: true
},
Parameters: {
Provider: 'Alibaba1688',
ItemTitle: 'adidas',
Order: 'TotalVolumeDesc'
}
};
const rawParams = new URLSearchParams({
instanceKey: 'c4e85fb9-7f86-4091-8d38-73a7b4db3d79',
secret: OT_SECRET,
lang: OT_LANG,
sessionId: '', // Optional
format: 'json',
parameters: JSON.stringify(payload),
framePosition: 0,
frameSize: 50,
blockList: JSON.stringify({ Brand: true }),
provider: 'Alibaba1688',
itemTitle: 'adidas',
order: 'TotalVolumeDesc',
format: 'json'
}).toString();
const OTAPI_URL = 'https://otapi.net/service-json/BatchSearchItemsFrame';
// Sort keys alphabetically for canonical string
const sortedKeys = Object.keys(rawParams).sort();
const canonicalQuery = sortedKeys
.map(k => `${k}=${encodeURIComponent(rawParams[k])}`)
.join('&');
// Generate HMAC-SHA1 signature using your OT_SECRET
const signature = crypto
.createHmac('sha1', OT_SECRET)
.update(canonicalQuery)
.digest('hex');
// Final full URL with signature
const finalUrl = `${serviceUrl}?${canonicalQuery}&signature=${signature}`;
axios.get(finalUrl)
.then(response => {
console.log(JSON.stringify(response.data, null, 2));
})
.catch(error => {
console.error('Request failed:', error.response?.data || error.message);
});
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0452 ]-- |