Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
[Java] How would I output the following JSON?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="RastaLulz" data-source="post: 281435" data-attributes="member: 1"><p>I'm trying to register a user via a XenForo API add-on, which returns information in the form of JSON. I need to be able to check if any errors are in the JSON response, and if they are, go through each one, and send the message to the player; meaning I'd have to loop through "errors".</p><p></p><p>Here's what the JSON file would look like:</p><p>[CODE]{</p><p> "errors":{</p><p> "email":"Email addresses must be unique. The specified email address is already in use.",</p><p> "username":"Usernames must be unique. The specified username is already in use."</p><p> },</p><p> "system_info":{</p><p> "visitor_id":0,</p><p> "time":1398536381</p><p> }</p><p>}[/CODE]</p><p></p><p>Obviously what the API returns is dynamic, so you won't always have an error for email or username, and could possibly have an error for something else. On top of that, if it's successful, it'll send the newly created users information, as oppose to any errors. Any help would be appreciated.</p></blockquote><p></p>
[QUOTE="RastaLulz, post: 281435, member: 1"] I'm trying to register a user via a XenForo API add-on, which returns information in the form of JSON. I need to be able to check if any errors are in the JSON response, and if they are, go through each one, and send the message to the player; meaning I'd have to loop through "errors". Here's what the JSON file would look like: [CODE]{ "errors":{ "email":"Email addresses must be unique. The specified email address is already in use.", "username":"Usernames must be unique. The specified username is already in use." }, "system_info":{ "visitor_id":0, "time":1398536381 } }[/CODE] Obviously what the API returns is dynamic, so you won't always have an error for email or username, and could possibly have an error for something else. On top of that, if it's successful, it'll send the newly created users information, as oppose to any errors. Any help would be appreciated. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
[Java] How would I output the following JSON?
Top