Authkey.state: Difference between revisions

From Safe Creative API
Jump to navigation Jump to search
w>Jguillo
No edit summary
m (12 revisions imported)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Returns the state of an authkey and the nonce key associated to it.
Returns the state of an authkey, the [[nonce key]] associated to it and optionally the [[User.quota|user quota]] of the the authorizing user.


= Info =
= Info =
Line 8: Line 8:
= Parameters =  
= Parameters =  
* '''authkey*:''' The authkey to query about
* '''authkey*:''' The authkey to query about
* '''userquota:''' Show the [[User.quota|user quota]] of the the authorizing user. (true|false)
* '''sharedkey*:''' Your application shared key
* '''sharedkey*:''' Your application shared key
* '''ztime*:''' Z-Timestamp
* '''ztime*:''' Z-Timestamp
Line 15: Line 16:
= Returns =
= Returns =
* '''authkeystate'''
* '''authkeystate'''
** '''authkey>''': authkey
** '''authkey''': authkey
** '''authorized''': Indicates if the authkey has been authorized (true|false)
** '''authorized''': Indicates if the authkey has been authorized (true|false)
** '''level''': Authorization level (GET|ADD|MANAGE)
** '''level''': Authorization level (GET|ADD|MANAGE)
** '''usercode''': Safe Creative code of the authorizing user
** '''usercode''': Safe Creative code of the authorizing user
** '''noncekey''': Nonce key associated to the authkey
** '''username''': Full name of the authorizing user
** '''noncekey''': [[Nonce key]] associated to the authkey
If userquota parameter is true the quota info is added:
* '''userquota'''
** '''diskUsage''': Disk usage in bytes
** '''diskQuota''': Disk quota in bytes
** '''monthlyRegistrations''': Number of registrations in current month
** '''monthlyRegistrationsQuota''': Maximum number of registrations per month


= Sample =
= Example =


REQUEST:
REQUEST:
Line 35: Line 43:
RESPONSE (not authorized):
RESPONSE (not authorized):


<?xml version="1.0" encoding="UTF-8"?>
<pre>
'''<authkeystate>'''
<?xml version="1.0" encoding="UTF-8"?>
  '''<authkey>'''23j22wtpoguzgzk0fag39sey6'''</authkey>'''
<authkeystate>
  '''<authorized>'''false'''</authorized>'''
  <authkey>23j22wtpoguzgzk0fag39sey6</authkey>
'''</authkeystate>'''
  <authorized>false</authorized>
</authkeystate>
</pre>


RESPONSE (authorized):
RESPONSE (authorized):


<?xml version="1.0" encoding="UTF-8"?>
<pre>
  '''<authkeystate>
<?xml version="1.0" encoding="UTF-8"?>
  '''<authkey>'''23j22wtpoguzgzk0fag39sey6'''</authkey>'''
<authkeystate>
  '''<authorized>'''true'''</authorized>'''
  <authkey>23j22wtpoguzgzk0fag39sey6</authkey>
  '''<level>'''MANAGE'''</level>'''
  <authorized>true</authorized>
  '''<usercode>'''0907300000160'''</usercode>'''
  <level>MANAGE</level>
  '''<noncekey>'''4vrghpn0n8jxrrvoi3b7zta1c'''</noncekey>'''
  <usercode>0907300000160</usercode>
'''</authkeystate>'''
  <username>Test User</username>
  <noncekey>4vrghpn0n8jxrrvoi3b7zta1c</noncekey>
</authkeystate>
</pre>
 
REQUEST (with quota):
 
  <nowiki>https://api.safecreative.org/v2/</nowiki>
?'''authkey'''=23j22wtpoguzgzk0fag39sey6
&'''component'''=authkey.state
&'''sharedkey'''=zy9x4ol0ctg3btyswq7b5wi9
&'''userquota'''=true
&'''ztime'''=1271749822816
&'''signature'''=7d6ec7ad668da907286ee2901448af8e3581e37e
 
RESPONSE (with quota):
 
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<authkeystate>
  <authkey>23j22wtpoguzgzk0fag39sey6</authkey>
  <authorized>true</authorized>
  <level>MANAGE</level>
  <usercode>0907300000160</usercode>
  <username>Test User</username>
  <noncekey>4vrghpn0n8jxrrvoi3b7zta1c</noncekey>
  <userquota>
    <diskUsage>26342745810</diskUsage>
    <diskQuota>100000000000</diskQuota>
    <monthlyRegistrations>1553</monthlyRegistrations>
    <monthlyRegistrationsQuota>5000</monthlyRegistrationsQuota>
  </userquota>
</authkeystate>
</pre>


[[Category:API component]]
[[Category:API component]]

Latest revision as of 08:07, 7 May 2021

Returns the state of an authkey, the nonce key associated to it and optionally the user quota of the the authorizing user.

Info

  • Component name: authkey.state
  • Signature: Requires signature using the sharedkey's private key
  • Timestamp: Requires ztime parameter

Parameters

  • authkey*: The authkey to query about
  • userquota: Show the user quota of the the authorizing user. (true|false)
  • sharedkey*: Your application shared key
  • ztime*: Z-Timestamp

* Required parameter

Returns

  • authkeystate
    • authkey: authkey
    • authorized: Indicates if the authkey has been authorized (true|false)
    • level: Authorization level (GET|ADD|MANAGE)
    • usercode: Safe Creative code of the authorizing user
    • username: Full name of the authorizing user
    • noncekey: Nonce key associated to the authkey

If userquota parameter is true the quota info is added:

  • userquota
    • diskUsage: Disk usage in bytes
    • diskQuota: Disk quota in bytes
    • monthlyRegistrations: Number of registrations in current month
    • monthlyRegistrationsQuota: Maximum number of registrations per month

Example

REQUEST:

https://api.safecreative.org/v2/
?authkey=23j22wtpoguzgzk0fag39sey6
&component=authkey.state
&sharedkey=zy9x4ol0ctg3btyswq7b5wi9
&ztime=1271749822816
&signature=7d6ec7ad668da907286ee2901448af8e3581e37e


RESPONSE (not authorized):

<?xml version="1.0" encoding="UTF-8"?>
<authkeystate>
  <authkey>23j22wtpoguzgzk0fag39sey6</authkey>
  <authorized>false</authorized>
</authkeystate>

RESPONSE (authorized):

<?xml version="1.0" encoding="UTF-8"?>
<authkeystate>
  <authkey>23j22wtpoguzgzk0fag39sey6</authkey>
  <authorized>true</authorized>
  <level>MANAGE</level>
  <usercode>0907300000160</usercode>
  <username>Test User</username>
  <noncekey>4vrghpn0n8jxrrvoi3b7zta1c</noncekey>
</authkeystate>

REQUEST (with quota):

https://api.safecreative.org/v2/
?authkey=23j22wtpoguzgzk0fag39sey6
&component=authkey.state
&sharedkey=zy9x4ol0ctg3btyswq7b5wi9
&userquota=true
&ztime=1271749822816
&signature=7d6ec7ad668da907286ee2901448af8e3581e37e

RESPONSE (with quota):

<?xml version="1.0" encoding="UTF-8"?>
<authkeystate>
  <authkey>23j22wtpoguzgzk0fag39sey6</authkey>
  <authorized>true</authorized>
  <level>MANAGE</level>
  <usercode>0907300000160</usercode>
  <username>Test User</username>
  <noncekey>4vrghpn0n8jxrrvoi3b7zta1c</noncekey>
  <userquota>
    <diskUsage>26342745810</diskUsage>
    <diskQuota>100000000000</diskQuota>
    <monthlyRegistrations>1553</monthlyRegistrations>
    <monthlyRegistrationsQuota>5000</monthlyRegistrationsQuota>
  </userquota>
</authkeystate>