Update Random Result Tables
NOTE: This is a Legacy Economy API, and is in bugfix-only mode. All new Economy features are being developed only for version 2. Updates the random drop table configuration for the title
Error codes
This operation may return the following PlayFab errors:
| Error | Code |
|---|---|
| InvalidDropTable | 1201 |
| InvalidJSONContent | 1200 |
| ProductDisabledForTitle | 1609 |
curl --request POST \
--url https://{titleId}.playfabapi.com/Admin/UpdateRandomResultTables \
--header 'Content-Type: application/json' \
--header 'X-SecretKey: <api-key>' \
--data '
{
"Tables": [
{
"TableId": "DropTable 1",
"Nodes": [
{
"ResultItem": "Gold Crown 1",
"Weight": 20
},
{
"ResultItem": "Magic Sword 3",
"Weight": 50
},
{
"ResultItem": "Clear Shield 3",
"Weight": 70
}
]
}
]
}
'import requests
url = "https://{titleId}.playfabapi.com/Admin/UpdateRandomResultTables"
payload = { "Tables": [
{
"TableId": "DropTable 1",
"Nodes": [
{
"ResultItem": "Gold Crown 1",
"Weight": 20
},
{
"ResultItem": "Magic Sword 3",
"Weight": 50
},
{
"ResultItem": "Clear Shield 3",
"Weight": 70
}
]
}
] }
headers = {
"X-SecretKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-SecretKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
Tables: [
{
TableId: 'DropTable 1',
Nodes: [
{ResultItem: 'Gold Crown 1', Weight: 20},
{ResultItem: 'Magic Sword 3', Weight: 50},
{ResultItem: 'Clear Shield 3', Weight: 70}
]
}
]
})
};
fetch('https://{titleId}.playfabapi.com/Admin/UpdateRandomResultTables', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{titleId}.playfabapi.com/Admin/UpdateRandomResultTables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'Tables' => [
[
'TableId' => 'DropTable 1',
'Nodes' => [
[
'ResultItem' => 'Gold Crown 1',
'Weight' => 20
],
[
'ResultItem' => 'Magic Sword 3',
'Weight' => 50
],
[
'ResultItem' => 'Clear Shield 3',
'Weight' => 70
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-SecretKey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{titleId}.playfabapi.com/Admin/UpdateRandomResultTables"
payload := strings.NewReader("{\n \"Tables\": [\n {\n \"TableId\": \"DropTable 1\",\n \"Nodes\": [\n {\n \"ResultItem\": \"Gold Crown 1\",\n \"Weight\": 20\n },\n {\n \"ResultItem\": \"Magic Sword 3\",\n \"Weight\": 50\n },\n {\n \"ResultItem\": \"Clear Shield 3\",\n \"Weight\": 70\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-SecretKey", "<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(string(body))
}HttpResponse<String> response = Unirest.post("https://{titleId}.playfabapi.com/Admin/UpdateRandomResultTables")
.header("X-SecretKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"Tables\": [\n {\n \"TableId\": \"DropTable 1\",\n \"Nodes\": [\n {\n \"ResultItem\": \"Gold Crown 1\",\n \"Weight\": 20\n },\n {\n \"ResultItem\": \"Magic Sword 3\",\n \"Weight\": 50\n },\n {\n \"ResultItem\": \"Clear Shield 3\",\n \"Weight\": 70\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{titleId}.playfabapi.com/Admin/UpdateRandomResultTables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-SecretKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Tables\": [\n {\n \"TableId\": \"DropTable 1\",\n \"Nodes\": [\n {\n \"ResultItem\": \"Gold Crown 1\",\n \"Weight\": 20\n },\n {\n \"ResultItem\": \"Magic Sword 3\",\n \"Weight\": 50\n },\n {\n \"ResultItem\": \"Clear Shield 3\",\n \"Weight\": 70\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"status": "<string>",
"data": {}
}{
"code": 123,
"errorCode": 123,
"status": "<string>",
"error": "<string>",
"errorMessage": "<string>",
"errorDetails": {}
}Authorizations
This API requires a title secret key, available to title admins, from PlayFab Game Manager.
Body
This operation is additive. Tables with TableId values not currently defined will be added, while those with TableId values matching Tables currently in the catalog will be overwritten with the given values.
This operation is additive. Tables with TableId values not currently defined will be added, while those with TableId values matching Tables currently in the catalog will be overwritten with the given values.
which catalog is being updated. If null, update the current default catalog version
The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
array of random result tables to make available (Note: specifying an existing TableId will result in overwriting that table, while any others will be added to the available set)
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://{titleId}.playfabapi.com/Admin/UpdateRandomResultTables \
--header 'Content-Type: application/json' \
--header 'X-SecretKey: <api-key>' \
--data '
{
"Tables": [
{
"TableId": "DropTable 1",
"Nodes": [
{
"ResultItem": "Gold Crown 1",
"Weight": 20
},
{
"ResultItem": "Magic Sword 3",
"Weight": 50
},
{
"ResultItem": "Clear Shield 3",
"Weight": 70
}
]
}
]
}
'import requests
url = "https://{titleId}.playfabapi.com/Admin/UpdateRandomResultTables"
payload = { "Tables": [
{
"TableId": "DropTable 1",
"Nodes": [
{
"ResultItem": "Gold Crown 1",
"Weight": 20
},
{
"ResultItem": "Magic Sword 3",
"Weight": 50
},
{
"ResultItem": "Clear Shield 3",
"Weight": 70
}
]
}
] }
headers = {
"X-SecretKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-SecretKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
Tables: [
{
TableId: 'DropTable 1',
Nodes: [
{ResultItem: 'Gold Crown 1', Weight: 20},
{ResultItem: 'Magic Sword 3', Weight: 50},
{ResultItem: 'Clear Shield 3', Weight: 70}
]
}
]
})
};
fetch('https://{titleId}.playfabapi.com/Admin/UpdateRandomResultTables', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{titleId}.playfabapi.com/Admin/UpdateRandomResultTables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'Tables' => [
[
'TableId' => 'DropTable 1',
'Nodes' => [
[
'ResultItem' => 'Gold Crown 1',
'Weight' => 20
],
[
'ResultItem' => 'Magic Sword 3',
'Weight' => 50
],
[
'ResultItem' => 'Clear Shield 3',
'Weight' => 70
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-SecretKey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{titleId}.playfabapi.com/Admin/UpdateRandomResultTables"
payload := strings.NewReader("{\n \"Tables\": [\n {\n \"TableId\": \"DropTable 1\",\n \"Nodes\": [\n {\n \"ResultItem\": \"Gold Crown 1\",\n \"Weight\": 20\n },\n {\n \"ResultItem\": \"Magic Sword 3\",\n \"Weight\": 50\n },\n {\n \"ResultItem\": \"Clear Shield 3\",\n \"Weight\": 70\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-SecretKey", "<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(string(body))
}HttpResponse<String> response = Unirest.post("https://{titleId}.playfabapi.com/Admin/UpdateRandomResultTables")
.header("X-SecretKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"Tables\": [\n {\n \"TableId\": \"DropTable 1\",\n \"Nodes\": [\n {\n \"ResultItem\": \"Gold Crown 1\",\n \"Weight\": 20\n },\n {\n \"ResultItem\": \"Magic Sword 3\",\n \"Weight\": 50\n },\n {\n \"ResultItem\": \"Clear Shield 3\",\n \"Weight\": 70\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{titleId}.playfabapi.com/Admin/UpdateRandomResultTables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-SecretKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Tables\": [\n {\n \"TableId\": \"DropTable 1\",\n \"Nodes\": [\n {\n \"ResultItem\": \"Gold Crown 1\",\n \"Weight\": 20\n },\n {\n \"ResultItem\": \"Magic Sword 3\",\n \"Weight\": 50\n },\n {\n \"ResultItem\": \"Clear Shield 3\",\n \"Weight\": 70\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"status": "<string>",
"data": {}
}{
"code": 123,
"errorCode": 123,
"status": "<string>",
"error": "<string>",
"errorMessage": "<string>",
"errorDetails": {}
}