English 中文(简体)
采用垂直信号灯
原标题:Send Direct Messages using twitter API

我试图利用前波段发送使用C#的直接信息,但推特说:

“远程服务器回归了一个错误:(401) 未经许可。

但这是没有意义的,因为我可以在我获得授权时使用其他的APIC电话。

一些背景信息:

我在申请许可时提出了申请: 阅读、写作和获取直接信息

我可以uc地在我的时间表中表明立场:

https://dev.twitter.com/docs/api/1/post/statuses/update”rel=“nofollow”>https://dev.twitter.com/docs/api/1/post/statuses/update

I could also retrieve all the direct messages sent to me:

https://dev.twitter.com/docs/api/1/get/direct_messages

问题在于我试图发出一个直接信息:

https://dev.twitter.com/docs/api/1/post/direct_messages/new

最佳回答

I couldn t figure out yet what s wrong, but I could make it work using a open source project called tweetsharp. You can download it and see the code that works:

Tweet Sharp

here is a code example

    var service = new TwitterService(consumerKey, consumerSecret, accessToken, accessTokenSecret);
var user = service.VerifyCredentials();
var result = service.SendDirectMessage(recipient, message);
问题回答

Have you checked that you are following the message recipient and that they are following you? This must be the case before you can DM a person.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签