Twitter-API-v2-sample-code icon indicating copy to clipboard operation
Twitter-API-v2-sample-code copied to clipboard

Add PHP samples

Open mhawry opened this issue 4 years ago • 11 comments

Added PHP sample code.

mhawry avatar Jun 07 '21 12:06 mhawry

CLA Assistant Lite bot All Contributors have signed the CLA. If the commit check is not passing, a maintainer must go the Checks tab of this PR and rerun the GitHub Action.

github-actions[bot] avatar Jun 07 '21 12:06 github-actions[bot]

I have read the CLA Document and I hereby sign the CLA

mhawry avatar Jun 07 '21 12:06 mhawry

recheck

mhawry avatar Jun 07 '21 12:06 mhawry

Thank you for these submissions! It might take me a little while to check over them (my PHP skills are a little rusty, but this is a good opportunity to refresh them!). Much appreciated.

andypiper avatar Jun 09 '21 13:06 andypiper

@andypiper thanks! Let me know if you have any questions/concerns.

mhawry avatar Jun 11 '21 01:06 mhawry

Hello @andypiper just wondering if you had a chance to look into this. Thanks!

mhawry avatar Jan 05 '22 00:01 mhawry

I just added a few more PHP samples. Is there someone at Twitter who can review this pull request?

Thanks!

mhawry avatar Jan 26 '23 07:01 mhawry

Anyone check these to make sure they actually work? None of the examples work for me, all return the exception message without any values for $errors, $status_code.

Yes, I changed the appropriate values for tokens, username, id, etc. It is an existing app in my account so no reason it shouldn't work.

morrow95 avatar Apr 22 '23 16:04 morrow95

@morrow95 I just tested again and it works for me.

Can you please share the code you are using and the error you are getting?

mhawry avatar Apr 22 '23 18:04 mhawry

@mhawry Apologies. Turned out it was partly due to not having a cacert.pem on my local dev. However, I did notice, atleast for the ones I was interested in using, I couldn't just use the bearer token as in the code - it required the actual oauth.

morrow95 avatar Apr 23 '23 01:04 morrow95

@morrow95 which of the samples required OAuth authorization? I'll look into it.

mhawry avatar Apr 23 '23 15:04 mhawry