Пытаюсь отправить голосовое SMS с помощью arkesel, но каждый раз, запуская команду, я получаю эту ошибку
"Не удалось совершить вызов: ошибка Arkesel: требуется ключ "contents"
Я попробовал добавить этот `->asMultipart()`, потому что тестировал конечную точку с помощью почтальона, используя данные формы с 'voice_file' (который я загрузил почтальону) и 'recipients[]' (который был номер телефона), работает в почтальоне
public function makeCall($recipients)
{
$filePath = storage_path('app/public/assets/harvard.wav');
// Check if the file exists
if (!file_exists($filePath)) {
throw new Exception("Audio file not found at {$filePath}");
}
try {
$response = Http::withHeaders([
'api-key' => $this->apiKey
])
->attach('voice_file', fopen($filePath, 'r'), 'harvard.wav') // Attach the audio file
->post('https://sms.arkesel.com/api/v2/sms/voice/send', [
'recipients' => $recipients,
]);
// Check for successful response
if ($response->successful()) {
Log::info("Voice SMS sent successfully with Arkesel: ", ['recipients' => $recipients, 'response' => $response->json()]);
return $response->json();
} else {
Log::error("Voice SMS failed: ", ['recipients' => $recipients, 'error' => $response->body()]);
throw new Exception("Arkesel Error: " . $response->body());
}
} catch (Exception $e) {
Log::error("Voice SMS failed with exception: ", ['recipients' => $recipients, 'error' => $e->getMessage()]);
throw new Exception("Arkesel Error: " . $e->getMessage());
}
}```
Подробнее здесь: https://stackoverflow.com/questions/791 ... s-required
Не удалось совершить вызов: Ошибка Arkesel: требуется ключ «Содержимое». ⇐ Php
Кемеровские программисты php общаются здесь
1730319660
Anonymous
Пытаюсь отправить голосовое SMS с помощью arkesel, но каждый раз, запуская команду, я получаю эту ошибку
"Не удалось совершить вызов: ошибка Arkesel: требуется ключ "contents"
Я попробовал добавить этот `->asMultipart()`, потому что тестировал конечную точку с помощью почтальона, используя данные формы с 'voice_file' (который я загрузил почтальону) и 'recipients[]' (который был номер телефона), работает в почтальоне
public function makeCall($recipients)
{
$filePath = storage_path('app/public/assets/harvard.wav');
// Check if the file exists
if (!file_exists($filePath)) {
throw new Exception("Audio file not found at {$filePath}");
}
try {
$response = Http::withHeaders([
'api-key' => $this->apiKey
])
->attach('voice_file', fopen($filePath, 'r'), 'harvard.wav') // Attach the audio file
->post('https://sms.arkesel.com/api/v2/sms/voice/send', [
'recipients' => $recipients,
]);
// Check for successful response
if ($response->successful()) {
Log::info("Voice SMS sent successfully with Arkesel: ", ['recipients' => $recipients, 'response' => $response->json()]);
return $response->json();
} else {
Log::error("Voice SMS failed: ", ['recipients' => $recipients, 'error' => $response->body()]);
throw new Exception("Arkesel Error: " . $response->body());
}
} catch (Exception $e) {
Log::error("Voice SMS failed with exception: ", ['recipients' => $recipients, 'error' => $e->getMessage()]);
throw new Exception("Arkesel Error: " . $e->getMessage());
}
}```
Подробнее здесь: [url]https://stackoverflow.com/questions/79142680/failed-to-make-calls-arkesel-error-a-contents-key-is-required[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия