New STW Account API [BETA]

3 posts / 0 new
Last post
puravida's picture
puravida
Jedi Warrior
Offline
Joined: 09/01/2007
Visit puravida's Website

Today, I am pleased to announce a new piece of functionality for integrators: an account API.

This API will allow integrators to easily pull an account's permissions, using the user supplied credentials. This way, you can just ask for the STW credentials, make a request to the account API, and then show only the options that are allowed for the account.

This can greatly reduce support issues by automating configuration.

NOTE: The account.php script is NOT a replacement for the xino.php script. They are completely separate and the account.php script is ONLY for obtaining account permissions.

NOTE: You should call this function ONLY when loading or saving a ShrinkTheWeb configuration page. The response values should be stored in the database and pulled from there, unless they need to be updated. In other words, do not call this API on every request or page load to display thumbnails.

It is called like this:
http://images.shrinktheweb.com/account.php?stwaccesskeyid=[user_access_key]&stwu=[user_secret_key]

If the access key or the secret key are incorrect, then a "FAIL" response will be returned:
http://images.shrinktheweb.com/account.php?stwaccesskeyid=&stwu=

If you "view source", you will see the XML response. This API XML response also includes a full XSD (XML Schema Data) so that it is compliant with SimpleXML and related parsers.

LEGEND
Status = Success || Fail
Account_Level = 0 (Free), 1 (Basic), 2 (PLUS)
Each of the PRO features = 0 (off) or 1 (on)

A status of "Fail" will always return all 0's for the rest of the fields.

puravida's picture
puravida
Jedi Warrior
Offline
Joined: 09/01/2007
Visit puravida's Website

We will be releasing an update, in the next week, to our sample PHP code that contains an example of pulling out the values from the XML feed. Stay tuned. Smile

puravida's picture
puravida
Jedi Warrior
Offline
Joined: 09/01/2007
Visit puravida's Website

We have released some sample code for the account API and it is included in a minor revision of the PHP Sample Code (v2.0.2). You may view the announcement here.

ShrinkTheWeb® (About STW) is another innovation by Neosys Consulting
Contact Us | PagePix Benefits | Learn More | STW Forums | Our Partners | Privacy Policy | Terms of Use

Announcing Javvy, the best crypto exchange and wallet solution (coming soon!)

©2018 ShrinkTheWeb. All rights reserved. ShrinkTheWeb is a registered trademark of ShrinkTheWeb.