-
-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to set param for direct message #282
Comments
Hmm. Are you able to post the full error (ie. what line the error is occuring on? |
Yes, the error is occurring on line number 362 in tmhOAuth/tmhOAuth.php file. I think when we are sending the params as per the twitter APIs not able to use because an error occurred in the below code in prepare_params()function.
I hope it will help to debug and investigate. |
Hey @pspatel I've pushed up a fix in this PR: Would you be able to test and double check it's working correctly now (as we don't have any automated unit/integration tests) You can do this by switching your version constraint to Thanks! |
Hi @atymic I have tested as per your suggestion and have checked your changes in tmhOAuth.php file but you only changed in one place for checking string or not. As per above screenshot I think need to change in full function and also may be in other related function for $v variable. I hope it will help you to look into it. Thanks |
Oops :) Looks like I missed some of the other occurrences, which look more complex. I'll have a look and see if we can patch it. |
Yes, it little bit complex and need to change on many places. Let me know if I can help you in testing or in any way, so that it will work smoothly for messaging APIs. |
Resolveram o problema? |
I'm on the same boat as well. I think we also need to handle the request with |
So I tried to get this working on |
@sykezz Can you send a link to your fork with the changes? :) |
@atymic The one I did on
On
|
anyone got a fix to this error? I am still getting it |
@sykezz I tried that and it works perfectly. |
@giennjoro what did you try that worked (what version?)? |
@andywise0 I believe he tried atymic/tmhOAuth#3. |
@sykezz Thanks... From what I can see that's a patch waiting to be merged |
@andywise0 You can change your composer.json to load the package from Github from the PR branch if you want.
|
This has been fixed with version 2.2.14. Sample usage: $recipientId = xxxxxxxxxxxx;
$pmMesage = 'Hello World';
$params = [
'type' => 'message_create',
'message_create' => [
'target' => ['recipient_id' => $recipientId],
'message_data' => ["text" => $pmMesage],
],
];
$response = $twitter->postDm($params); |
Awesome job @reliq! 🎉 |
@sykezz thanks (I have now used version 2.2.14 as its been released) |
Should be fixed now, thanks @reliq :D |
Nice |
Hello There,
I have integrated this in my web app and now wants to use direct message but I am able to send because getting error.
Array to string conversion
so it means either I am using and sending parameters wrong in postDm method or something need to change in tmhOAuth.php which we are using for sending request.
Please let me know how I can create params and can use direct message apis.
Here is the code sample which I am following ->
The text was updated successfully, but these errors were encountered: