The STRICT Tag and default behavior

ClickaPost’s Server is VERY loose when it comes to the data it receives. If any of REQUIRED fields are missing – the post saving will fail by default, however, if there is anything wrong with the OPTIONAL data you provide (an ID, state name, city name, etc.) the system will automatically try to compensate for this by either guessing the correct value or removing it completely.

If for some reason you would like ClickaPost NOT to save the post if any of your OPTIONAL fields throw an exception, all you have to do is set <strict> tag in <auth> branch of the XML request to TRUE.

When <strict> is set to TRUE, any problem with your post will cause the post not to be stored and it will return the error instead. This strictly includes all REQUIRED fields, AND any issues with the following OPTIONAL tags:

  • <duration>, <showPriceValue>, <showPriceType>, <stateProvince>, <city>, all <keywords>, all <photos> all <videos>, and all <embededVideos>

This means, if any of the data is provided for the above tags (since they are optional), and something happens to be wrong with the data (wrong keyword options, price not numeric, wrong duration choice, wrong price type, inexistent state or city, non functional photo or video links, incorrect embedded videos data, etc.) – the post experiencing these issues will NOT be stored, but will rather return an error. This way, you can set your system any way you like. If you really want every single detail to be correct and you wish your post not to go through in case something is not being validated properly set <STRICT> to true, otherwise leave it as it is and 99% of your posts will simply go through.

Note: the only errors ClickaPost will accept in both STRICT and non-STRICT mode are if <title> and <subtitle> are LONGER than 60 characters (in which case they will simply be truncated down to 60 characters and a note will be made)

Note 2: the only errors ClickaPost will accept in STRICT mode: due to time it takes to check the “existence” of any photos and/or videos you may have submitted – ClickaPost will only check for a valid syntax of the <link> URLs and image/video extensions of the files they link to while processing the XML. If a <link> you specified is formed correctly but it turns out to be inaccessible when all files for your post are scheduled to download – the file will simply be skipped. You should always keep an eye on the Log in the ClickaPost API section of My ClickaPost module since even though some of your posts may pass the initial XML parser check – if STRICT mode is enabled they may fail because the files were not able to be downloaded.

Next Step

 
the_strict_tag.txt · Last modified: 2008/12/15 21:14 by peconi
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki