Obtener información combinada del jugador
Retrieves all of the user’s different kinds of info.
Error codes
This operation may return the following PlayFab errors:
| Error | Code |
|---|---|
| RequestViewConstraintParamsNotAllowed | 1303 |
curl --request POST \
--url https://{titleId}.playfabapi.com/Client/GetPlayerCombinedInfo \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"PlayFabId": "4027527BF22653D1",
"InfoRequestParameters": {
"GetUserAccountInfo": true,
"GetUserVirtualCurrency": true,
"GetUserData": true,
"UserDataKeys": [
"preferences",
"progress"
]
}
}
'import requests
url = "https://{titleId}.playfabapi.com/Client/GetPlayerCombinedInfo"
payload = {
"PlayFabId": "4027527BF22653D1",
"InfoRequestParameters": {
"GetUserAccountInfo": True,
"GetUserVirtualCurrency": True,
"GetUserData": True,
"UserDataKeys": ["preferences", "progress"]
}
}
headers = {
"X-Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Authorization': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
PlayFabId: '4027527BF22653D1',
InfoRequestParameters: {
GetUserAccountInfo: true,
GetUserVirtualCurrency: true,
GetUserData: true,
UserDataKeys: ['preferences', 'progress']
}
})
};
fetch('https://{titleId}.playfabapi.com/Client/GetPlayerCombinedInfo', 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/Client/GetPlayerCombinedInfo",
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([
'PlayFabId' => '4027527BF22653D1',
'InfoRequestParameters' => [
'GetUserAccountInfo' => true,
'GetUserVirtualCurrency' => true,
'GetUserData' => true,
'UserDataKeys' => [
'preferences',
'progress'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Authorization: <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/Client/GetPlayerCombinedInfo"
payload := strings.NewReader("{\n \"PlayFabId\": \"4027527BF22653D1\",\n \"InfoRequestParameters\": {\n \"GetUserAccountInfo\": true,\n \"GetUserVirtualCurrency\": true,\n \"GetUserData\": true,\n \"UserDataKeys\": [\n \"preferences\",\n \"progress\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Authorization", "<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/Client/GetPlayerCombinedInfo")
.header("X-Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"PlayFabId\": \"4027527BF22653D1\",\n \"InfoRequestParameters\": {\n \"GetUserAccountInfo\": true,\n \"GetUserVirtualCurrency\": true,\n \"GetUserData\": true,\n \"UserDataKeys\": [\n \"preferences\",\n \"progress\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{titleId}.playfabapi.com/Client/GetPlayerCombinedInfo")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"PlayFabId\": \"4027527BF22653D1\",\n \"InfoRequestParameters\": {\n \"GetUserAccountInfo\": true,\n \"GetUserVirtualCurrency\": true,\n \"GetUserData\": true,\n \"UserDataKeys\": [\n \"preferences\",\n \"progress\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"status": "OK",
"data": {
"PlayFabId": "4027527BF22653D1",
"InfoResultPayload": {
"AccountInfo": {
"PlayFabId": "4027527BF22653D1",
"Created": "2013-04-07T09:04:28",
"Username": "my name",
"TitleInfo": {
"Origination": "IOS",
"Created": "2014-01-08T11:03:18",
"LastLogin": "2014-04-07T09:04:28",
"FirstLogin": "2014-01-08T11:03:18",
"TitlePlayerAccount": {
"Id": "174812abf712",
"Type": "title_player_account",
"TypeString": "title_player_account"
}
},
"FacebookInfo": {
"FacebookId": "23525445454"
},
"SteamInfo": {
"SteamCountry": "US",
"SteamCurrency": "USD"
},
"GameCenterInfo": {
"GameCenterId": "someone"
}
},
"UserVirtualCurrency": {
"GC": 15
},
"UserVirtualCurrencyRechargeTimes": {
"GC": {
"SecondsToRecharge": 3600,
"RechargeTime": "2014-01-01T12:00:00",
"RechargeMax": 50
}
},
"UserData": {
"preferences": {
"Value": "alpha",
"LastUpdated": "2014-08-20T12:30:45",
"Permission": "Public"
},
"progress": {
"Value": "level_twenty",
"LastUpdated": "2014-09-01T10:12:30"
}
},
"UserDataVersion": 12,
"PlayerProfile": {
"TitleId": "TitleName",
"PlayerId": "10931252888739651331",
"Created": "0001-01-01T00:00:00",
"LastLogin": "0001-01-01T00:00:00",
"BannedUntil": "9999-12-31T23:59:59.9999999",
"DisplayName": "PlayerDisplayName",
"TotalValueToDateInUSD": 0
}
}
}
}{
"code": 123,
"errorCode": 123,
"status": "<string>",
"error": "<string>",
"errorMessage": "<string>",
"errorDetails": {}
}Autorizaciones
This API requires a client session ticket, available from any Client Login function.
Cuerpo
Flags for which pieces of info to return for the user.
Show child attributes
Show child attributes
{
"GetUserAccountInfo": true,
"GetUserVirtualCurrency": true,
"GetUserData": true,
"UserDataKeys": ["preferences", "progress"]
}
The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
PlayFabId of the user whose data will be returned. If not filled included, we return the data for the calling player.
Respuesta
Returns whatever info is requested in the response for the user. If no user is explicitly requested this defaults to the authenticated user. If the user is the same as the requester, PII (like email address, facebook id) is returned if available. Otherwise, only public information is returned. All parameters default to false.
The Http status code. If X-ReportErrorAsSuccess header is set to true, this will report the actual http error code.
The Http status code as a string.
Returns whatever info is requested in the response for the user. If no user is explicitly requested this defaults to the authenticated user. If the user is the same as the requester, PII (like email address, facebook id) is returned if available. Otherwise, only public information is returned. All parameters default to false.
Show child attributes
Show child attributes
{
"PlayFabId": "4027527BF22653D1",
"InfoResultPayload": {
"AccountInfo": {
"PlayFabId": "4027527BF22653D1",
"Created": "2013-04-07T09:04:28",
"Username": "my name",
"TitleInfo": {
"Origination": "IOS",
"Created": "2014-01-08T11:03:18",
"LastLogin": "2014-04-07T09:04:28",
"FirstLogin": "2014-01-08T11:03:18",
"TitlePlayerAccount": {
"Id": "174812abf712",
"Type": "title_player_account",
"TypeString": "title_player_account"
}
},
"FacebookInfo": { "FacebookId": "23525445454" },
"SteamInfo": {
"SteamCountry": "US",
"SteamCurrency": "USD"
},
"GameCenterInfo": { "GameCenterId": "someone" }
},
"UserVirtualCurrency": { "GC": 15 },
"UserVirtualCurrencyRechargeTimes": {
"GC": {
"SecondsToRecharge": 3600,
"RechargeTime": "2014-01-01T12:00:00",
"RechargeMax": 50
}
},
"UserData": {
"preferences": {
"Value": "alpha",
"LastUpdated": "2014-08-20T12:30:45",
"Permission": "Public"
},
"progress": {
"Value": "level_twenty",
"LastUpdated": "2014-09-01T10:12:30"
}
},
"UserDataVersion": 12,
"PlayerProfile": {
"TitleId": "TitleName",
"PlayerId": "10931252888739651331",
"Created": "0001-01-01T00:00:00",
"LastLogin": "0001-01-01T00:00:00",
"BannedUntil": "9999-12-31T23:59:59.9999999",
"DisplayName": "PlayerDisplayName",
"TotalValueToDateInUSD": 0
}
}
}
Temas relacionados
Obtener información combinada del jugadorCómo obtener datos internos del jugadorTutorial Obtener un perfil de jugadorInicio rápido de datos del jugadorCómo obtener datos de solo lectura del jugador¿Esta página le ayudó?
curl --request POST \
--url https://{titleId}.playfabapi.com/Client/GetPlayerCombinedInfo \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"PlayFabId": "4027527BF22653D1",
"InfoRequestParameters": {
"GetUserAccountInfo": true,
"GetUserVirtualCurrency": true,
"GetUserData": true,
"UserDataKeys": [
"preferences",
"progress"
]
}
}
'import requests
url = "https://{titleId}.playfabapi.com/Client/GetPlayerCombinedInfo"
payload = {
"PlayFabId": "4027527BF22653D1",
"InfoRequestParameters": {
"GetUserAccountInfo": True,
"GetUserVirtualCurrency": True,
"GetUserData": True,
"UserDataKeys": ["preferences", "progress"]
}
}
headers = {
"X-Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Authorization': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
PlayFabId: '4027527BF22653D1',
InfoRequestParameters: {
GetUserAccountInfo: true,
GetUserVirtualCurrency: true,
GetUserData: true,
UserDataKeys: ['preferences', 'progress']
}
})
};
fetch('https://{titleId}.playfabapi.com/Client/GetPlayerCombinedInfo', 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/Client/GetPlayerCombinedInfo",
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([
'PlayFabId' => '4027527BF22653D1',
'InfoRequestParameters' => [
'GetUserAccountInfo' => true,
'GetUserVirtualCurrency' => true,
'GetUserData' => true,
'UserDataKeys' => [
'preferences',
'progress'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Authorization: <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/Client/GetPlayerCombinedInfo"
payload := strings.NewReader("{\n \"PlayFabId\": \"4027527BF22653D1\",\n \"InfoRequestParameters\": {\n \"GetUserAccountInfo\": true,\n \"GetUserVirtualCurrency\": true,\n \"GetUserData\": true,\n \"UserDataKeys\": [\n \"preferences\",\n \"progress\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Authorization", "<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/Client/GetPlayerCombinedInfo")
.header("X-Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"PlayFabId\": \"4027527BF22653D1\",\n \"InfoRequestParameters\": {\n \"GetUserAccountInfo\": true,\n \"GetUserVirtualCurrency\": true,\n \"GetUserData\": true,\n \"UserDataKeys\": [\n \"preferences\",\n \"progress\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{titleId}.playfabapi.com/Client/GetPlayerCombinedInfo")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"PlayFabId\": \"4027527BF22653D1\",\n \"InfoRequestParameters\": {\n \"GetUserAccountInfo\": true,\n \"GetUserVirtualCurrency\": true,\n \"GetUserData\": true,\n \"UserDataKeys\": [\n \"preferences\",\n \"progress\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"status": "OK",
"data": {
"PlayFabId": "4027527BF22653D1",
"InfoResultPayload": {
"AccountInfo": {
"PlayFabId": "4027527BF22653D1",
"Created": "2013-04-07T09:04:28",
"Username": "my name",
"TitleInfo": {
"Origination": "IOS",
"Created": "2014-01-08T11:03:18",
"LastLogin": "2014-04-07T09:04:28",
"FirstLogin": "2014-01-08T11:03:18",
"TitlePlayerAccount": {
"Id": "174812abf712",
"Type": "title_player_account",
"TypeString": "title_player_account"
}
},
"FacebookInfo": {
"FacebookId": "23525445454"
},
"SteamInfo": {
"SteamCountry": "US",
"SteamCurrency": "USD"
},
"GameCenterInfo": {
"GameCenterId": "someone"
}
},
"UserVirtualCurrency": {
"GC": 15
},
"UserVirtualCurrencyRechargeTimes": {
"GC": {
"SecondsToRecharge": 3600,
"RechargeTime": "2014-01-01T12:00:00",
"RechargeMax": 50
}
},
"UserData": {
"preferences": {
"Value": "alpha",
"LastUpdated": "2014-08-20T12:30:45",
"Permission": "Public"
},
"progress": {
"Value": "level_twenty",
"LastUpdated": "2014-09-01T10:12:30"
}
},
"UserDataVersion": 12,
"PlayerProfile": {
"TitleId": "TitleName",
"PlayerId": "10931252888739651331",
"Created": "0001-01-01T00:00:00",
"LastLogin": "0001-01-01T00:00:00",
"BannedUntil": "9999-12-31T23:59:59.9999999",
"DisplayName": "PlayerDisplayName",
"TotalValueToDateInUSD": 0
}
}
}
}{
"code": 123,
"errorCode": 123,
"status": "<string>",
"error": "<string>",
"errorMessage": "<string>",
"errorDetails": {}
}