Я пытаюсь интегрироваться с API Sabre, используя PHP и свои тестовые учетные данные. Однако я получаю ответ: «Массив ([ошибка] => инвалид_клиент [ошибка_описание] => Неверный clientID или clientSecret)».
Документация Sabre:
https://developer .sabre.com/docs/rest_apis/session_management/token_create_api/v2
https://developer.sabre.com/guides/trav ... apis-token -credentials
Любые предложения или помощь по моему коду приветствуются.
$saberUrl = 'https://api.platform.sabre.com/v2/auth/token';
$credentials = [
'user_id' => 'V1:uname:DEVCENTER:AA',
'password' => 'pwd'
];
$base64EncodeConcat =base64_encode(base64_encode($credentials['user_id']) . ':' . base64_encode($credentials['password']));
// Initialize cURL session
$curl = curl_init($saberUrl);
// Set cURL options
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Basic ' . $base64EncodeConcat
));
// Include the grant_type parameter in the POST fields
curl_setopt($curl, CURLOPT_POSTFIELDS, "grant_type=client_credentials");
// Execute cURL session
$response = curl_exec($curl);
// Close cURL session
curl_close($curl);
// Process the response
$data = json_decode($response, true);
// Output the data
print_r($data);
Подробнее здесь: https://stackoverflow.com/questions/790 ... ntegration
Интеграция Sabre Dev API ⇐ Php
Кемеровские программисты php общаются здесь
1728959017
Anonymous
Я пытаюсь интегрироваться с API Sabre, используя PHP и свои тестовые учетные данные. Однако я получаю ответ: «Массив ([ошибка] => инвалид_клиент [ошибка_описание] => Неверный clientID или clientSecret)».
Документация Sabre:
https://developer .sabre.com/docs/rest_apis/session_management/token_create_api/v2
https://developer.sabre.com/guides/travel-agency/developer-guides/rest-apis-token -credentials
Любые предложения или помощь по моему коду приветствуются.
$saberUrl = 'https://api.platform.sabre.com/v2/auth/token';
$credentials = [
'user_id' => 'V1:uname:DEVCENTER:AA',
'password' => 'pwd'
];
$base64EncodeConcat =base64_encode(base64_encode($credentials['user_id']) . ':' . base64_encode($credentials['password']));
// Initialize cURL session
$curl = curl_init($saberUrl);
// Set cURL options
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Basic ' . $base64EncodeConcat
));
// Include the grant_type parameter in the POST fields
curl_setopt($curl, CURLOPT_POSTFIELDS, "grant_type=client_credentials");
// Execute cURL session
$response = curl_exec($curl);
// Close cURL session
curl_close($curl);
// Process the response
$data = json_decode($response, true);
// Output the data
print_r($data);
Подробнее здесь: [url]https://stackoverflow.com/questions/79088231/sabre-dev-api-integration[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия