• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

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