Create an inbound RTB
POST
/api/v1/inbound-rtb
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://external-api.moja-ai.com/api/v1/inbound-rtb"), Headers = { { "X-API-Key", "<X-API-Key>" }, }, Content = new StringContent("{ \"inbound_rtb_id\": \"example\", \"campaign_id\": \"example\", \"publisher_id\": \"example\", \"payout_mode\": \"dynamic\", \"payout_percentage\": 80, \"duration_add_seconds\": 0, \"payout\": 1, \"payout_condition\": \"call_length_connected\", \"payout_condition_duration\": 1, \"allocation_time_seconds\": 60, \"rate_limit\": 100, \"rate_period\": \"min\", \"is_active\": true, \"receive_mode\": \"dynamic\", \"receive_number_id\": \"example\", \"external_id\": \"example\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://external-api.moja-ai.com/api/v1/inbound-rtb"
payload := strings.NewReader("{ \"inbound_rtb_id\": \"example\", \"campaign_id\": \"example\", \"publisher_id\": \"example\", \"payout_mode\": \"dynamic\", \"payout_percentage\": 80, \"duration_add_seconds\": 0, \"payout\": 1, \"payout_condition\": \"call_length_connected\", \"payout_condition_duration\": 1, \"allocation_time_seconds\": 60, \"rate_limit\": 100, \"rate_period\": \"min\", \"is_active\": true, \"receive_mode\": \"dynamic\", \"receive_number_id\": \"example\", \"external_id\": \"example\" }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<X-API-Key>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://external-api.moja-ai.com/api/v1/inbound-rtb';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"inbound_rtb_id":"example","campaign_id":"example","publisher_id":"example","payout_mode":"dynamic","payout_percentage":80,"duration_add_seconds":0,"payout":1,"payout_condition":"call_length_connected","payout_condition_duration":1,"allocation_time_seconds":60,"rate_limit":100,"rate_period":"min","is_active":true,"receive_mode":"dynamic","receive_number_id":"example","external_id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://external-api.moja-ai.com/api/v1/inbound-rtb \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "inbound_rtb_id": "example", "campaign_id": "example", "publisher_id": "example", "payout_mode": "dynamic", "payout_percentage": 80, "duration_add_seconds": 0, "payout": 1, "payout_condition": "call_length_connected", "payout_condition_duration": 1, "allocation_time_seconds": 60, "rate_limit": 100, "rate_period": "min", "is_active": true, "receive_mode": "dynamic", "receive_number_id": "example", "external_id": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
InboundRtbCreate
object
inbound_rtb_id
required
Inbound Rtb Id
string
campaign_id
required
Campaign Id
string
publisher_id
required
Publisher Id
string
payout_mode
Payout Mode
string
allocation_time_seconds
Allocation Time Seconds
integer
rate_limit
Rate Limit
integer
rate_period
Rate Period
string
is_active
Is Active
boolean
receive_mode
Receive Mode
string
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
InboundRtbResponse
object
id
required
Id
integer
inbound_rtb_id
required
Inbound Rtb Id
string
campaign_id
required
Campaign Id
string
publisher_id
required
Publisher Id
string
payout_mode
required
Payout Mode
string
allocation_time_seconds
required
Allocation Time Seconds
integer
rate_limit
required
Rate Limit
integer
rate_period
required
Rate Period
string
is_active
required
Is Active
boolean
receive_mode
Receive Mode
string
Example
{ "receive_mode": "dynamic"}Bad Request
Media typeapplication/json
ErrorResponse
object
detail
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
Examplegenerated
{ "detail": { "code": "example", "message": "example" }}Unauthorized
Media typeapplication/json
ErrorResponse
object
detail
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
Examplegenerated
{ "detail": { "code": "example", "message": "example" }}Not Found
Media typeapplication/json
ErrorResponse
object
detail
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
Examplegenerated
{ "detail": { "code": "example", "message": "example" }}Conflict
Media typeapplication/json
ErrorResponse
object
detail
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
Examplegenerated
{ "detail": { "code": "example", "message": "example" }}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}Too Many Requests
Media typeapplication/json
ErrorResponse
object
detail
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
Examplegenerated
{ "detail": { "code": "example", "message": "example" }}
