microsoft-foundry.rest.security.o-auth2-auth
Realtime
Decline a SIP call
POST
/openai/v1/realtime/calls/{call_id}/reject
Declines an incoming SIP call by returning a SIP status code to the caller.
Parâmetros de caminho
call_id
string
obrigatório
The identifier for the call provided in the
realtime.call.incoming
webhook.
Corpo do Pedido
Provide an optional SIP status code. When omitted the API responds with
603 Decline.
Content-Type: application/json
status_code
integer
Respostas
The request has succeeded.
Pedir
curl -X POST https://api.openai.com/v1/realtime/calls/$CALL_ID/reject \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status_code": 486}'
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
await client.realtime.calls.reject('call_id');
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
client.realtime.calls.reject(
call_id="call_id",
)
package main
import (
"context"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
"github.com/openai/openai-go/realtime"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Realtime.Calls.Reject(
context.TODO(),
"call_id",
realtime.CallRejectParams{},
)
if err != nil {
panic(err.Error())
}
}
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.realtime.calls.CallRejectParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
client.realtime().calls().reject("call_id");
}
}
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
result = openai.realtime.calls.reject("call_id")
puts(result)