Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 541637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:21:48+00:00 2026-05-13T10:21:48+00:00

I am working on building an REST API in PHP, I need to know

  • 0

I am working on building an REST API in PHP, I need to know if it’s possible to to POST an array of methods/functions and params to my api script and have my code run the listed functions and print to the screen an array that the functions produced, example if a user sent a request to get a list of 5 photo url’s it would post a PHP array with the 5 URLs in an array and then be able to use that array in the persons script who is using the API?

So basicly you post to a script with CURL a list, array of functions you want the API to run, the api returns an array of results but instead of formatting to JSON or XML it shows it on the screen as PHP array and then curl will let the user’s code run the returned php array as real php in there script?

Sorry if this is confusing but it really seems that the bebo.com API works this exact way and possibly facebook API so I think this would work but could someone tell me? Possibly some examples of how to do it if it is possible, thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:21:48+00:00Added an answer on May 13, 2026 at 10:21 am

    I have found that JSON-RPC is a fantastic solution for batching API requests. It is significantly simpler to put multiple API requests in a single JSON-RPC request than any XML solution I have seen (although only version 1.1 and higher of the spec supports this). Since it is all just JSON it works wonderfully regardless of what server-side (or client-side) language is consuming the results. The only problem I have found is that the spec is a little wonky if you want to implement all of the potential versions.

    For safety, you should:

    • Strictly limit which PHP functions/methods anonymous users are allowed to call without authentication.
    • Use the PHP Reflection API to do initial validation of parameters. You can use reflection to do the following:
      • Ensure a method exists and is public (return an HTTP 404 if it does not, 403 if the user is not authorized).
      • Count the number of parameters a function or method accepts.
      • Determine parameters are optional or required.
      • Determine the names of parameters so they can be passed as a JSON object.
      • If you use PHP 5.1+ you can examine the doc comments to determine what the the accepted data type is for each parameter.
    • Strictly validate parameters further inside each API call.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on building a PHP/Zend REST webservice and one of its methods
I'm working on building the URLs for my REST API before I begin writing
I'm getting started on building a REST API for a project I'm working on,
I am presently working on building an user referral tracking script in PHP ,
I am working on a jersey rest client and I am building my client
I'm working on building a tree structure in MySQL and have been experimenting with
I'm working on building a library for a client to integrate with LinkedIn's API
I am working on building my first search-engine friendly CMS. I know that perhaps
I'm building/working with an API and I make a call to the server and
I am currently working on building a classifier using c5.0. I have a dataset

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.