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

  • SEARCH
  • Home
  • 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 8508433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:09:35+00:00 2026-06-11T03:09:35+00:00

I am Trying to Tag a picture and posting it through graphs However, when

  • 0

I am Trying to Tag a picture and posting it through graphs However, when I remove the 'tags' => $tags from below, it works. Otherwise I get this error:

Array ( [error] => Array ( [message] => (#100) param tags must be an array. [type] => OAuthException [code] => 100 ) )

Here is my code:

<?php
$tags = array(
    'to' => $_SESSION['my_fb_id'],
    'x' => 0,
    'y' => 0
);

 $tag[]= $tags ;
//
//upload photo
$file = 'imgtmp/save_as_this_name.jpg';
$args = array(
    'message' => 'This is my Picture',
    'tags' => $tag, // IF this line is removed ,It works!
);
$args[basename($file)] = '@' . realpath($file);
$ch = curl_init();
$url = 'https://graph.facebook.com/me/photos?access_token=' . $_SESSION['access_token'];
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
$data = curl_exec($ch);
print_r(json_decode($data, true));
?>
  • 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-06-11T03:09:36+00:00Added an answer on June 11, 2026 at 3:09 am

    Tags must be array of tags as you can tag many people.

    $tag1 = array(
        'tag_text' => 'tag test1',
        'tag_uid' => 'XXXXX1',
        'x' => 0,
        'y' => 0
    );
    
    $tag2 = array(
        'tag_text' => 'tag test2',
        'tag_uid' => 'XXXXX2',
        'x' => 0,
        'y' => 0
    );
    
    $tags = array($tag1, $tag2);
    

    In your case

    $args = array(
        'message' => 'This is my Picture',
        'tags' => array( $tags ) , 
    );
    

    EDIT 1:

    To tag photos successfully you will require user_photos permission.

    Using graph api

    $file = 'test.jpg';
    $tags = array(
        'tag_text' => 'tag test',
        'tag_uid' => 'XXXXX',
        'x' => 10,
        'y' => 10
    );
    
    $args['tags'] = array($tags);
    $args[basename($file)] = '@' . realpath($file);
    $data = $facebook->api("/me/photos", "post", $args);
    
    print_r($data);
    

    Edit 2:

    Just use json_encode for tags parameter

    $args['tags'] = json_encode(array($tags));
    

    This will solve the issue while using cURL.

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

Sidebar

Related Questions

This is a question based on: Trying to get tag-it to work with an
I had been trying to get the tag name and its value in java
I'm trying to edit this submit tag to make it disable itself once I
I'm trying to take a picture from the Camera using intent with onActivityResult but
ive been trying to render a picture from carrierwave. i believe it is uploaded
I'm trying to retrieve a contact picture, contact name, and mobile phone number from
I'm trying to make this: <span class=introduction> <img alt=image src=/picture.jpg /> </span> transform into
Trying to add carrier wave based image uploading to my user model. This works
I'm trying to tag a picture file with a date in Cocoa and are
I'm trying to extract the date/time when a picture was taken from the CR2

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.