2011-09-15 3 views
0

私はカールインターフェイスとしてcurb-fu gemを使用しています。私はSMSメッセージを送信するためにgrouptexting APIに従おうとしています。ここでcurb-fu gemのヘルプ - そのドキュメントは明るいです

彼らは、PHPで書かれた例を与える:

http://grouptexting.com/sms-gateway/sms-api-docs.html

そして私はそれがうまく動作するように取得することができます。

curb-fuにはほとんどドキュメントがありません。正しく動作するようには思えません。

phpで書かれたgrouptexting apiの例を見ると、誰かがそれをルビー/縁石に翻訳する手助けができますか?あるいは、誰かがcurb-fuのいくつかのより堅牢なドキュメントを指すことができますか?

答えて

1

READMEには、curb-fuの使用例がいくつか含まれています。利用可能なYARD-generated API documentationもあります。

私のために使用するのはかなり簡単です。ルビー+縁石-FUは

response = CurbFu.post('https://app.grouptexting.com/api/sending', { 
    :user => "username", :pass => "userpassword", 
    :phonenumber => "2125551234", :subject => "test", 
    :message => "test message" 
}) 
puts response.body 
に変換における

このPHP例

<?php 
$ch=curl_init('https://app.grouptexting.com/api/sending'); 
curl_setopt($ch,CURLOPT_POST,1); 
curl_setopt($ch,CURLOPT_POSTFIELDS,"user=username&pass=userpassword&phonenumber= 2125551234&subject=test&message=test message"); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); 
$data = curl_exec($ch); 
print($data); /* result of API call*/ 
?> 

関連する問題