I'm trying facebook Graph API calls into the Graph API Explorer ( https://developers.facebook.com/tools/explorer?method=GET&path=me/notifications ).
I can get notifications with this call " me/notifications ".
Then, I want to mark notifications as read, but it doesn't seem to work. I choose a notification id and I tried several ways :
notif_100007738631831_980288?unread=0
notif_100007738631831_980288/?unread=0
notif_100007738631831_980288?unread=false
notif_100007738631831_980288/?unread=false
notif_100007738631831_980288/?read=1
I get the notification informations, but the unread value is always " 1 " and the " unseen_count " when I get back all notifications has always the same value.
Any idea ?
What do I make wrong ?
Thanks for your help ! :)
(Sorry for my bad english... :( )
Related
I'm trying to send a email with the plugin.manager.mail. The email gets send to the right address, but the subject and body are empty. ( I've checked, I put the & in front of $message so I reference to it.)
Then I checked with loggers, but my MYMODULE_mail($key, &$message, $params) doesn't get called.
Maybe some background, I'm using this in an EventSubscriber so I can monitor an action and then send the email. The eventSubscriber monitors the events from Simple Fb Connect
( https://www.drupal.org/docs/8/modules/simple-fb-connect-8x/eventsubscriber-example )
The link above links to the code I use, so in the function userLogin(GenericEvent $event) I load my mailmanager and send the mail and in the same file I place the hook MYMODULE_mail($key, &$message, $params) {}
I have the feeling I'm placing this hook at the wrong place or naming it wrong. Can someone help me?
Thanks in advance!
The hook MYMODULE_mail needs to be in the MYMODULE.module file and not in the same file where you monitor the events.
Clear cache and normally you're good to go
I have recently started with WSO2 CEP. connected to a topic where many messages pass, but suppose I just want to get the messages of a type, for example all messages that have type TT -> {"name": " hello "," type ":" TT "}, I have seen that the messageSelector can be used but I do not know how to use it. An example-> type: 'TT'
I do not know if I'm treating him well since the ones are json.
Sorry for the English ;).
Have you tried to set the messageSelector parameter as follows in the receiver configurations?
<property name="transport.jms.MessageSelector">type='TT'</property>
I'm new to OTRS (3.2) and also new to PERL but I have been given the task of setting up OTRS so that it will make a call to our remote webservice so a record can be created on our end when a ticket is set as "Closed".
I set up various dynamic fields so the customer service rep can fill in additional data that will be passed into the webservice call along with ticket details.
I couldn't get the webservice call to trigger when the ticket was "Closed" but I did get it to trigger when the "priority" was changed so I'm just using that now to test the webservice.
I'm just using the Test.pm and TestSimple.pm files that were included with OTRS.
When I look at the Debugger for the Webserice, I can see that the calls were being made:
$VAR1 = {
'TicketID' => '6'
};
My webservice currently just has one method "create" which just returns true for testing.
however I get the following from the Test.pm
"Got no TicketNumber (2014-09-02 09:20:42, error)"
and the following from the TestSimple.pm
"Error in SOAP call: 404 Not Found at /TARGET/SHARE/var/otrs/Kernel/GenericInterface/Transport/HTTP/SOAP.pm line 578 (2014-09-02 09:20:43, error)
I've spent countless hours on Google but couldn't find anything on this. All I could find is code for the Test.pm and TestSimple.pm but nothing really helpful to help me create a custom invoker for my needs and configure the webservice in OTRS to get it to work.
Does anyone have any sample invokers that I can look at to see how to set it up?
Basically I need to pass the ticket information along with my custom dynamic fields to my webservice. From there I can create the record on my end and do whatever processing.
I'm not sure how to setup the Invoker to pass the necessary ticket fields and dynamic fields and how to make it call a specific method in my remote webservice.
I guess getting the Test.pm and TestSimple.pm to work is the first step then I can modify those for my needs. I have not used PERL at all so any help is greatly appreciated.
I'm also struggling with similar set of requirements too. I've also never programmed in PERL, but I can tell you at least that the "Got no TicketNumber" in the Test.pm is right from the PrepareRequest method, there you can see this block of code:
# we need a TicketNumber
if ( !IsStringWithData( $Param{Data}->{TicketNumber} ) ) {
return $Self->{DebuggerObject}->Error( Summary => 'Got no TicketNumber' );
}
You should change all references to TicketNumber to TicketID, or remove the validation whatsoever (also there is mapping to ReturnedData variable).
Invoking specific methods on your WS interface is quite simple (but poorly documented). The Invoker name that you specify in the "OTRS as requester" section of web service configuration corresponds to the WS method that will be called. So if you have WS interface with a method called "create" just name the Invoker "create" too.
As far as the gathering of dynamic field goes, can't help you on that one yet, sorry.
Cheers
I started having a look into Facebook API today. I couldn' say enough how ugly and totally unintuitive it is, at least its Javascript implementation. Anyway, here's the two things I found:
a. I struggled whole day getting 'undefined' messages after properly loggin and getting an access_toekn, now when I tried to write response.first_name after calling FB.api ('/me') I got 'undefined' messages..... Well, I burnt my brain until I got someone here in stackoverflow that said the access token should HAVE to be passed in the call! But you can't find THIS CLEARLY specified in the FB official documentation, it's not even mentioned, not even parameter is shown. So this works:
FB.api('/me', {access_token: taccesstokenvalue}, function(response) {
alert(response.first_name); });
b. now, if I change alert() by document.write() , well, it just does nothing.
c. console.log() never worked out, I Tried on chrome, firefox, opera. Nothing
Why can't I use document.write? I need to verbosely write a lot of things coming out from the API, how can I do it ?
Thanks!!
Well, I found out a solution I think. Hope it helps other people...
I solved it this way:
a. create a form on top of the body area, with hidden field called hAPIresponse and hAccessToken
b. instead of trying to dump the API response right inside the function() as in the code above, fill the hidden fields with what the API returns, concatenating fields one after another if needed, like this:
FB.api('/me', {access_token: taccesstokenvalue}, function(response) {
document.getElementById("hAPIresponse").value="first name:" + response.first_name;
document.getElementById("hAccessToken").value="access token:" + taccesstokenvalue;
});
*here I didn't concatenate anything, just got the first_name property from the API
c. taccesstokenvalue variable comes from previously retrieving it from the URL or you can retrieve it directly through the API. Here comes the manual approach:
function Mid(str, start, len)
{
// Make sure start and len are within proper bounds
if (start < 0 || len < 0) return "";
var iEnd, iLen = String(str).length;
if (start + len > iLen)
iEnd = iLen;
else
iEnd = start + len;
return String(str).substring(start,iEnd);
}
var taccesstoken=window.location.href;
var tvecaux=taccesstoken.split('access_token=');
var taccesstokenvalue=Mid(tvecaux[1],0, tvecaux[1].indexOf('&',0) );
As far as I saw, when you get into the FB.api() call the code CONTINUES TO EXECUTE below the FB.API() call and not through the function(response). This one is triggered asynchronously by its own will, when it thinks it's better to finish :) It seems it's so complicated for FB developers adding a sync=true/false property in the FB.Init() so people used to sync coding won't pull their hairs out of their heads as I did..
Hope it helps somebody, I spent nearly 36 hours trying to do something so simple and stupid like calling an API and retrieving a value from it...
Again, this API couldn't be less intuitive, I can't say it enough. I can't imagine what I will find when trying to pull coments to FB Post replies or even trying to interact with the FB chat
I'm having an issue while creating orchestration by consuming webservice
Web message response variable name - msgReponse.webserviceResponse
multipart message response variable name - msgResponse.multipartresponse
I'm receiving the webmessage type(msgwebserviceResponse.Respone) from the webport.
Then after receive shape, I'm trying to map that response with another message.
So, here when I try map them by using the transfer shape, When I want to select msgResponse.multipartresponse as input schema for the map, I'm seeing msgResponse.multipartresponse(I can't see this, as I'm recieving msgReponse.webserviceResponse at receive shape)
could you please help me on this?
Thank You,
I had similar problems with yours. Asked a question and got an answer. Check this.