Jump to content

XMLRPC API needs more STUFF!


Mat Barrie

Recommended Posts

Posted

So, there's this cool API right that I can use to integrate other apps right? WRONG! It seems the XMLRPC API only allows fetching data from IPBoard, not putting to it (with the exception of posting topics and replies). I'd really love it if this could be fleshed out so that I can actually modify members via the XMLRPC API. Before you suggest just using IPSMember::load, that won't work - an ASP.NET application cannot execute PHP for obvious reasons. I can use direct SQL writes, but the member DB schema is terrible (a DB column per custom profile field?!?) and I prefer not to allow any of my apps to access other apps data directly so I'd rather not.

The short version is - more updateability via the XML RPC API please.

Posted

It would definitely be nice to have more API functions, and I'm sure there will be more added in the future, but I don't know what version that will be.

Posted

Thanks. I´m trying to develop a iphone app to read from ipboard and write new posts...



How can i get all the forums? The method 'fetchForums' only returns info about the forumids specified as param.


Should i write my own xmlrpc api to fetchForums with parentid 'x' ? where x can be 'root' or any forumid?



Is possible with only one api_key write post for multiple users? how can i authenticate a user/password with this apis? (if possible) if is not possible, can you tell me any function i can call to verify user/password and write my own api?



Thanks





I added my own fechAllForums to methods (same as fechForums changing the call to getForumList), but now i need to know how to add permission to my user api to run this method, because the authenticate method returns false.
I can see in the api_user bd table the permissions list, but dont know what should i add to run this new fecthAllForums method.
Can you help me?
Thanks




$ALLOWED_METHODS['fetchAllForums'] = array(

												   'in'  => array(

																	'api_key'           => 'string',

																	'api_module'        => 'string',

																	'forum_ids' 		=> 'string',

																	'view_as_guest'     => 'integer',

															     ),

												   'out' => array(

																	'response' => 'xmlrpc'

																 )

												 );			






public function fetchAllForums( $api_key, $api_module, $forum_ids, $view_as_guest )

	{

		//-----------------------------------------

		// INIT

		//-----------------------------------------


		$api_key       = IPSText::md5Clean( $api_key );

		$api_module    = IPSText::parseCleanValue( $api_module );

		$forum_ids     = ( $forum_ids ) ? explode( ',', IPSText::parseCleanValue( $forum_ids ) ) : null;

		$view_as_guest = intval( $view_as_guest );


		//-----------------------------------------

		// Authenticate

		//-----------------------------------------


		if ( $this->__authenticate( $api_key, $api_module, 'fetchAllForums' ) !== FALSE )

		{

			//-----------------------------------------

			// Add log

			//-----------------------------------------


			if ( ipsRegistry::$settings['xmlrpc_log_type'] != 'failed' )

			{

				$this->registry->DB()->insert( 'api_log', array(   'api_log_key'     => $api_key,

																	'api_log_ip'      => $_SERVER['REMOTE_ADDR'],

																	'api_log_date'    => time(),

																	'api_log_query'   => $this->classApiServer->raw_request,

																	'api_log_allowed' => 1 ) );

			}


			//-----------------------------------------

			// Get some classes

			//-----------------------------------------


			require_once( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php' );

			$appClass	= new app_class_forums( $this->registry );


			//-----------------------------------------

			// Fetch forum list

			//-----------------------------------------


			//$return	= array();


//			foreach( $forum_ids as $id )

//			{

//				$return[]	= $this->registry->getClass('class_forums')->forumsFetchData( $id );

//			}


			//$return[]	= $this->registry->getClass('class_forums')->getForumList();

			//-----------------------------------------

			// Return the data

			//-----------------------------------------


			//$this->classApiServer->apiSendReply( $return );

			$this->classApiServer->apiSendReply( 		$this->registry->getClass('class_forums')->getForumList());

			exit();

		}

	}


Posted

Answering myself again:

IPSMember have the function i need to authenticate user/password.....
I did the test with php xlmrpc calls...so now, with all i need ok, i will start the iphone development :)

  • 2 years later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...