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 6237843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:06:16+00:00 2026-05-24T11:06:16+00:00

I am working on an app through my developer test account and all I

  • 0

I am working on an app through my developer test account and all I am doing is trying to post a test notification to my user. I am doing this using the facebook requests 2.0 documentation, so my code looks like this:

$token_url = "https://graph.facebook.com/oauth/access_token?" .
              "client_id=" . $app_id .
              "&client_secret=" . $app_secret .
              "&grant_type=client_credentials";

              $app_access_token = file_get_contents($token_url);


              $user_id = $this->user->id;
              $apprequest_url ="https://graph.facebook.com/" .
                               $user_id .
                               "/apprequests?message='testing notification'" . 
                               "&"  .   
                               $app_access_token . "&method=post";

              $result = file_get_contents($apprequest_url);
              echo "Request id number: " . $result;

When i do this I get an error on the page that says “failed to open stream”, however when I copy and paste the url into the address bar I don’t get any errors and get returned a request id. Anybody know why this might be happening?

  • 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-24T11:06:18+00:00Added an answer on May 24, 2026 at 11:06 am

    I solved it using curl instead of file_get_contents. file_get_contents used to throw errors for some reason.

    the cpde for the curl is:

    $ch = curl_init();
            curl_setopt($ch, CURLOPT_TIMEOUT, 10);
            curl_setopt($ch, CURLOPT_URL, $apprequest_url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HEADER, false);
    
    $result = curl_exec($ch);
    curl_close($ch);
    

    I know I’m a litle late, but I hope it helps somebody.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a simple web application through Google App engine using
I am trying to test a app on my phone. I keep getting this
I'm working through an idea for an iphone app. One of the tech requirements
I'm working on a winform app and am interating through a checkboxlist to see
I'm working on a Rails app that sends data through a form. I want
Whilst trying to get our app working in Firefox (I'm a big proponent of
I'm trying to get a web app working based on the S#arp Architecture. At
I'm working on an app that requires no user input, but I don't want
I'm working through the Core Data Utility at http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CoreDataUtilityTutorial/Articles/00_introduction.html#//apple_ref/doc/uid/TP40001800-CH202-TP1 I've stumbled on a rather
I've been reading through this tutorial for using a SQLite database within an iPhone

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.