• We value your experience with Plesk during 2026
    Please help us understand which Plesk features made your work easier this year, what is still missing and how AI should help you in Plesk ?
    Take this short 5-minutes survey. Your answers go straight into the Plesk roadmap for 2027.

Getting token via API fails

tontsa

New Pleskian
Hi,

I'm trying to retrieve the auth token for standalone edition using the /api/5.3/sites/UUID/token/ but it fails with error:
{"error":{"message":"Attribute \"SB_Facade_Value_UiSettings::sessionLifeTime\" is not set"}}

In sb-server I have /usr/local/sb/tmp/sitebuilder.log :
code: 400 94.199.58.140 Zend_Http_Client
2012-11-15T12:37:03+02:00 [EMERG] [System] /api/5.3/sites/2338b43d-cd3c-e843-d00c-00461d334b44/token/ SB_Facade_Value_Exception: Attribute "SB_Facade_Value_UiSettings::sessionLifeTime" is not set
file: /usr/local/sb/include/SB/Facade/Value.php
line: 224

Any ideas how to fix that?

Thanks in advance,
Toni Mattila
 
Hi Toni.

Your request is incorrectly encoded. Correct request body is:
[{"localeCode":"fi_FI","sessionLifeTime":3600}]


For correct encoding on php you can use such example:

$data = array(
array(
'localeCode' => 'fi_FI',
'sessionLifeTime' => 3600
)
);
$body = json_encode($data);
 
Hi,

Indeed, I was blind to that double array. That solved the issue, thank you very much Egor!

Best Regards,
Toni
 
Back
Top