I am trying to delete a calendar event through the REST API and it is returning a 400 error.
The DELETE url:
https://outlook.office.com/api/v2.0/events/AQMkADA...URF1shGWDYAAAIBDQAAAOVip_uuQf5ApURF1shGWDYAAAAwSb9FAAAA
The call is generated in PHP using this code sample.
$delete_url = $outlookApiUrl . $outlook_id;
$response = $this->makeApiCall($this->access_token, $this->email, 'DELETE', $delete_url);
The URL was missing a "Me"
https://outlook.office.com/api/v2.0/Me/events/AQMkADA...
Related
I want to delete an event in Vtiger Calendar using REST APIs. I'm trying the following:
POST /webservice.php HTTP/1.1
operation=delete
sessionName=sessionId // Obtained through Login Operation
id=<WEBSERVICE_ID>
but I don't know what WEBSERVICE_ID is and where to find it.
When I create an event using REST-API it returns an array with the following data:
{"subject":"Follow up Test","assigned_user_id":"49x1","date_start":"2016-06-17","time_start":"09:00:00","time_end":"18:00:00","due_date":"2016-06-17","recurringtype":"","parent_id":"","contact_id":"","taskstatus":"","eventstatus":"Planned","taskpriority":"High","sendnotification":"0","createdtime":"2016-06-23 11:18:20","modifiedtime":"2016-06-23 11:18:20","activitytype":"Event","visibility":"","duration_hours":"9","duration_minutes":"0","location":"","notime":"0","modifiedby":"49x1","created_user_id":"49x1","source":"WEBSERVICE","starred":"0","tags":"","reminder_time":"","description":"Test Description","id":"1x5748","label":"Follow up Test"}
There is an id in the array ("id":"1x5748"), but when I try to use the id as a WEBSERVICE_ID in the delete operation I'm getting the following error:
Fatal error: Uncaught exception 'Exception' with message 'Error: Id specified is incorrect'
Run this query: SELECT id, nameFROM vtiger_ws_entity
Whith this your objectTypeId is a id for module
Get the record id
concatenate 1And2 for example: EVENTS module='18' AND record id=61900, then the ID that you need is: 18x61900;
I use this code for delete entity
$params = array(
//"id" => "35789",
"id" => "18x61900",
);
$record = $client->doInvoke("delete", $params, "POST");
I am trying to get to get clicks and spend data for ad campaigns.
I am currently getting all ad campaign ID's with a curl request which returns about 260 ID's.
I want to make a batch request and get the clicks, spend, start and end dates for each ID.
I have found the PHP SDK FacebookRequest() function very confusing so have been trying to make cURL requests.
Would really appreciate some help because I am just stumped at the moment. Is it best to use to FacebookRequest() function or can I continue using the cURL requests?
Not sure if I am on the right track but essentially what I have at the moment is all the campaign ID's which I group with a method, relative_url and body and then pass to a requestHandler function. The code is as follows:
$ad_account_ids = <ad_account_id>;
$ad_campaign_ids = FbAdCampaign::all()->lists('ad_campaign_id')->toArray();
foreach ($ad_campaign_ids as $key => $value) {
$ad_campaign_ids[$key] = array(
"method" => "GET",
"relative_url" => "v2.4/act_".$ad_account_ids."/adgroups",
"body" => "campaign_id=".$value."&redownload=1&bid_type=CPC&bid_info={\"clicks\":150}&creative={\"creative_id\":\"{result=create_creative:$.id}\"}&targeting={\"countries\":[\"US\"]}&name=test1"
);
$fields[] = array(
'access_token' => $access_token,
'batch' => $ad_campaign_ids[$key]
);
// $url = 'https://graph.facebook.com/v2.4/act_'.$ad_campaign_ids.'/adcampaign_groups?access_token='.$access_token;
$url = 'https://graph.facebook.com/';
$data = RequestHandler::curlRequest($url);
Ok got it.
Had to prepend the /GET data to the end of the URL to pass to the request handler.
as follows:
$url = 'https://graph.facebook.com/v2.3/act_'.$ad_account_ids.'/adcampaign_groups?access_token='.$access_token;
I'm trying to tag user(s) inside page post comments.
$fb_id = 'facebook_user_id_here';
$fb_name = 'facebook_user_name_and_surname_here';
$request = new FacebookRequest(
$this->session,
'POST',
$comment,
array(
'access_token' => $this->page_access_token, //it is access token of my page
'message => "Text here #[".$fb_id.":1:".$fb_name."]"
)
);
It shows only name and surname without Fb profile URL.
Like CBroe mentions in his comment, at this time this is not possible using the API.
For reference, this is called "mentioning" or "mention tagging", and personal profiles can only do this in messages on open graph actions (docs).
Pages can also mention other pages in comments. (docs)
Hi I created an app to load facebook event "wall posts" and "attending list" into a searchable form for use by door staff as a guestlist.
Recently it won't pull more than 10 posts from an events wall posts.
I've been playing about on the open graph explorer and have ran into the same problem. I can't get it to display more than ten results.
Why does it paginate now and why even if I add "since" and "until" parameters to the call does it still only display the last 10 posts on the wall?
If anyone could help me remove the pagination and get all results at once that would be magical!
Here's my call in my php:
$event_id = intval($_GET['id']);
$comments_id = '/' . $event_id . '/feed?fields=id,from,message';
$guestlist = (new FacebookRequest( $session, 'GET', $comments_id ))->execute()->getGraphObject()->getPropertyAsArray('data');
$i = 0; while($guestlist[$i]) {
echo $guestlist[$i]->getProperty('from')->getProperty('name');
echo nl2br($guestlist[$i]->getProperty('message'));
$i++;
}
Here's an example of an open graph request:
941122979255816/feed?fields=id,from,message
Here's an example facebook event:
facebook.com/events/941122979255816/
Here's my app:
events.sawhost.co.uk
Thanks
It seems that facebook is having some pagination issues. I guess all we can do is sit tight while they fix it
https://developers.facebook.com/bugs/809829259052996/
I'm using the following to post a message on my Facebook page:
$attachment = array(
'access_token' => $access_token,
'message' => 'This is a test Message 4:',
'name' => "This is a test Name 4",
'link' => "http://slashdot.org/",
'description' => "This is a test Description 4"
);
$ret_code=$facebook->api('/me/feed', 'POST', $attachment);
This works great.
How do I delete the same post using the facebook GRAPH api? I read the docs and it says to issue a POST like:
https://graph.facebook.com/COMMENT_ID?method=delete
To test I set this up in a simple form with submit button, POSTing the data to https://graph.facebook.com/COMMENT_ID?method=delete (substituting COMMENT_ID fro the 11111111111_111111111111 id returned from the original publish call. This returns "This API call requires a valid app_id".
What is the correct way to issue a DELETE command?
Since you are using the php-sdk you just issue this call:
$facebook->api("/COMMENT_ID","DELETE");
You can use the following code:
Http::post('https://graph.facebook.com/'.$fb_action_id, array('method'=>'delete', 'access_token'=>$your_app_access_token));
This post will return a boolean value, true if successed and false if failed.
Its been discussed here Facebook SDK and Graph API Comment Deleting Error
you need to pass the access token too. You can delete all the milestones of a page like follows:
$milestones = $facebook->api('/PAGE_ID/milestones');
foreach($milestones[data] as $milestone)
{
echo $milestone['id'];
$args = array(
'access_token' => $pages_access_token
);
$deleted = $facebook->api($milestone['id'],"delete",$args);
if($deleted)
{
echo " <font color=\"green\">OK</font><br>";
}
else
{
echo " <font color=\"red\">ERR</font><br>";
}
}