$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://online.moysklad.ru/api/remap/1.2/security/token');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$headers = array();
$headers[] = 'Authorization: Basic <Credentials>';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
Getting a new token
Request for a new token. As in other requests, in the Authorization header, the login:password pair is specified encoded in the RFC2045-MIME version of the Base64 standard. When a new access token is generated, the previously generated user tokens will be revoked.
- Where and how can I specify my login and password?
Thanks.