I assume/guess you want to build some sort of HTTP interface to allow people to retrieve data from your service.
WordPress as remote service
This can be done in several ways: Build a template that just spits out JSON-ified or XML-ed data with plain stupid PHP functions like
json_decode() or the
Another option would be to use WebHooks - there's a plugin for that case: HookPress.
Webhooks are a simple paradigm for developing instant notifications and mashups based on simple HTTP requests. With HookPress you can set up webhooks so that a specified URL (a public service or something you set up) is requested when certain WordPress actions occur. Possible uses include generating push notifications or using non-PHP web technology to extend WordPress.
- HookPress repo description
You can read more about WebHooks on this site. Even with old publishing dates, the posts are still worth reading.
Another option would be the WP HTTP API offered by WP core.
The last option are RSS Feeds, that WP also has built in.
WP has "privately" published pages. You can set a password and check for it with
post_password_required() - Assuming, that you're using a password on your page (private in submitdiv/publish meta box), you can question for this in your template and force the user to know & enter the password before reaching the content.
The normal hook to redirect is the
template_redirect hook. There you can redirect people properly and easily:
// Only for specific post types like 'post', 'page', 'some_custom_post_type'
if ( ! 'some_post_type' === get_post_type() )
// Your special file
include_once( get_stylesheet_directory.'some_template.php' );
// NEVER! forget to exit - else the default available WP template would jump in.
add_action( 'template_redirect', 'wpse62920_deny_access' );