WordPress.org

Ready to get started?Download WordPress

Forums

JSON API
create XML from JSON responce (4 posts)

  1. deepak.ghayal
    Member
    Posted 1 month ago #

    Hi, I am new to wordpress..
    Your plugin is works great, I just want ask we create XML by json responce. Means when I call http://example.com/api/user/get_userinfo/?user_id=1 then I get following responce {"status":"ok","id":1,"username":"admin","nicename":"admin","email":"deepak.ghayal@mediawide.com","url":"","displayname":"admin","firstname":"","lastname":"","nickname":"admin","avatar":null}

    It's great,
    But I want In Xml Format or Create XML of above response like this:
    <xml><status>Ok</status><id>1</id><username>admin</username>....
    </xml>
    So can how can we create?

    https://wordpress.org/plugins/json-api/

  2. TomekR
    Member
    Posted 1 month ago #

    Hi Deepak,
    Not answering directly to your question, but...

    I don't expect the plugin to respond in xml format, as even by name it is json :-). Also, this format is typical for REST services.
    So instead, you should deserizalize it on your side and serialize to xml, if you need xml.

  3. deepak.ghayal
    Member
    Posted 1 month ago #

    Thanks TomekR,
    I know that json is work great I appreciate it. Bcoz I also use same plugin for REST request it work Great.....
    My question is If I change json-api-user plugin's file json-api-user/controllers/User.php and in it change get_userinfo() function, can if affect to other services like retrieve_password, or json api plugin code...

  4. bobblah
    Member
    Posted 3 weeks ago #

    I can't answer your last question but I can tell you that in the past I was able to write some code in functions.php which created and updated an XML file every time a specific custom post type was added or edited. I'm not a coding expert but it wasn't that hard to do. So you may be better off searching for a solution like that instead of trying to modify this plugin.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.