|
2 | 2 | TeleSign |
3 | 3 | ======== |
4 | 4 |
|
5 | | -**Information**: For more information, visit the `TeleSign website <http://www.TeleSign.com>`_ or the `TeleSign Developer Portal <https://developer.telesign.com/>`_. |
6 | | - |
7 | | -**Author**: Telesign Corp. |
8 | | - |
9 | | -TeleSign Web Services: Ruby SDK |
10 | | ---------------------------------- |
11 | | - |
12 | | -**TeleSign web services** conform to the `REST Web Service Design Model <http://en.wikipedia.org/wiki/Representational_state_transfer>`_. Services are exposed as URI-addressable resources through the set of *RESTful* procedures in our **TeleSign REST API**. |
13 | | - |
14 | | -The **TeleSign Ruby SDK** is a set of software development tools—a *Ruby Library* that wraps the TeleSign REST API, and it simplifies TeleSign application development in the `Ruby programming language <https://www.ruby-lang.org/>`_. The SDK software is packaged as a Ruby gem called **telesign**, and is distributed using `Ruby Gems <https://rubygems.org/>`_. |
15 | | - |
16 | | -The Ruby Classes |
17 | | ------------------- |
18 | | - |
19 | | -With just two classes, **Telesign::API** abstracts much of the complexity of the TeleSign REST API. |
20 | | - |
21 | | -+---------------------------+--------------------------------------------------------------------------+ |
22 | | -| Ruby Class | Description | |
23 | | -+===========================+==========================================================================+ |
24 | | -| Telesign::API::PhoneId | The **PhoneId** class exposes four services that each provide | |
25 | | -| | information about a specified phone number. | |
26 | | -| | | |
27 | | -| | *standard* | |
28 | | -| | Retrieves the standard set of details about the specified phone | |
29 | | -| | number. This includes the type of phone (for example, land line or | |
30 | | -| | mobile), and its approximate geographic location. | |
31 | | -| | *score* | |
32 | | -| | Retrieves a score for the specified phone number. This ranks the | |
33 | | -| | phone number's "risk level" on a scale from 0 to 1000, so you can | |
34 | | -| | code your web application to handle particular use cases (for | |
35 | | -| | example, to stop things like chargebacks, identity theft, fraud, and | |
36 | | -| | spam). | |
37 | | -| | *contact* | |
38 | | -| | In addition to the information retrieved by *standard*, this service | |
39 | | -| | provides the name and address associated with the specified phone | |
40 | | -| | number. | |
41 | | -| | *live* | |
42 | | -| | In addition to the information retrieved by *standard*, this service | |
43 | | -| | provides actionable data associated with the specified phone number. | |
44 | | -| | *number_deactivation* | |
45 | | -| | In addition to the information retrieved by *standard*, this service | |
46 | | -| | provides information on number deactivation for the phone number | |
47 | | -| | provided. | |
48 | | -+---------------------------+--------------------------------------------------------------------------+ |
49 | | -| Telesign::API::Verify | The **Verify** class exposes five services for sending users a | |
50 | | -| | verification token (a three to five-digit number). You can use this | |
51 | | -| | mechanism to test whether you can reach users at the phone number | |
52 | | -| | they supplied, or you can have them use the token to authenticate | |
53 | | -| | themselves with your web application. In addition, this class also | |
54 | | -| | exposes a service that allows you to confirm the result of the | |
55 | | -| | authentication. | |
56 | | -| | | |
57 | | -| | You can use this verification factor in combination with *username* | |
58 | | -| | and *password* to provide *two-factor* authentication for higher | |
59 | | -| | security. | |
60 | | -| | | |
61 | | -| | *call* | |
62 | | -| | Calls the specified phone number and uses speech synthesis to speak | |
63 | | -| | the verification code to the user. | |
64 | | -| | *sms* | |
65 | | -| | Sends a text message containing the verification code to the | |
66 | | -| | specified phone number (supported for mobile phones only). | |
67 | | -| | *smart* | |
68 | | -| | Smart intelligently determines the best service to use based on | |
69 | | -| | the end user device and then attempts to place a call, send an SMS, | |
70 | | -| | or send a push request. | |
71 | | -| | *push* | |
72 | | -| | Sends a push notification containing the verification code to the | |
73 | | -| | specified phone number (supported for registered devices only). | |
74 | | -| | *status* | |
75 | | -| | Retrieves the verification result. You make this call in your web | |
76 | | -| | application after users complete the authentication transaction | |
77 | | -| | (using either a *call* or *sms*). | |
78 | | -| | | |
79 | | -+---------------------------+--------------------------------------------------------------------------+ |
80 | | -| Telesign::API::TeleBureau | The **Telebureau** class exposes services for creating, retrieving, | |
81 | | -| | updating and deleting telebureau fraud events. You can use this | |
82 | | -| | mechanism to test whether you can reach Telebureau services. | |
83 | | -| | | |
84 | | -| | *create* | |
85 | | -| | Creates a Telebureau event corresponding to supplied data. | |
86 | | -| | *retrieve* | |
87 | | -| | Retrieves the fraud event status. You make this call in your web | |
88 | | -| | application after completion of create/update transaction for a | |
89 | | -| | Telebureau event. | |
90 | | -| | *delete* | |
91 | | -| | Deletes a previously submitted fraud event. You make this call in | |
92 | | -| | your web application after completion of submit/update transaction | |
93 | | -| | for a Telebureau event. | |
94 | | -| | | |
95 | | -+---------------------------+--------------------------------------------------------------------------+ |
| 5 | +TeleSign provides the world’s most comprehensive approach to account security for Web and mobile applications. |
| 6 | + |
| 7 | +For more information about TeleSign, visit the `TeleSign website <http://www.TeleSign.com>`_. |
| 8 | + |
| 9 | +TeleSign REST API: Ruby SDK |
| 10 | +--------------------------- |
| 11 | + |
| 12 | +**TeleSign web services** conform to the `REST Web Service Design Model |
| 13 | +<http://en.wikipedia.org/wiki/Representational_state_transfer>`_. Services are exposed as URI-addressable resources |
| 14 | +through the set of *RESTful* procedures in our **TeleSign REST API**. |
| 15 | + |
| 16 | +The **TeleSign Ruby SDK** is a set modules and functions — a *Ruby Library* that wraps the |
| 17 | +TeleSign REST API, and it simplifies TeleSign application development in the `Ruby programming language |
| 18 | +<https://www.ruby-lang.org>`_. The SDK software is distributed on |
| 19 | +`GitHub <https://github.com/TeleSign/ruby_telesign>`_ and also as a Ruby Gem using `Ruby Gems <https://rubygems.org>`_. |
| 20 | + |
| 21 | +Documentation |
| 22 | +------------- |
| 23 | + |
| 24 | +Detailed documentation for TeleSign REST APIs is available in the `Developer Portal <https://developer.telesign.com/>`_. |
96 | 25 |
|
97 | 26 | Installation |
98 | 27 | ------------ |
99 | 28 |
|
100 | | -With `Ruby Gems <https://github.com/rubygems/rubygems>`_ |
101 | | -installed, type **gem install telesign** at the command prompt. |
| 29 | +To install the TeleSign Ruby SDK: |
| 30 | + |
| 31 | +.. code-block:: bash |
102 | 32 |
|
103 | | -Ruby Code Example: To Verify a Call |
104 | | -------------------------------------- |
| 33 | + $ gem install telesign |
105 | 34 |
|
106 | | -Here's a basic code example. |
| 35 | +Alternatively, you can download the project source, and execute **gem build telesign.gemspec && gem install telesign-[version].gem**. |
107 | 36 |
|
108 | | -:: |
| 37 | +Ruby Code Example: Messaging |
| 38 | +---------------------------- |
| 39 | + |
| 40 | +Here's a basic code example with JSON response. |
| 41 | + |
| 42 | +.. code-block:: ruby |
109 | 43 |
|
110 | 44 | require 'telesign' |
111 | | - phone_number = "13103409700" |
112 | | - cust_id = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890" |
113 | | - secret_key = "EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==" |
114 | | - verify = Telesign::API::Verify.new(cust_id, secret_key) # Instantiate a Verify instance object, |
115 | | - result = verify.call(phone_number) # and use it to call the "call" method. |
116 | | - p result.body |
117 | 45 |
|
118 | | - {"reference_id"=>"254CADA5F1D40E0090405467DE244D05", "resource_uri"=>"/v1/verify/254CADA5F1D40E0090405467DE244D05", "sub_resource"=>"call", "errors"=>[], "verify"=>{"code_state"=>"UNKNOWN", "code_entered"=>""}, "status"=>{"updated_on"=>"2016-02-29T05:04:06.814381Z", "code"=>103, "description"=>"Call in progress"}} |
| 46 | + customer_id = 'customer_id' |
| 47 | + secret_key = 'secret_key' |
119 | 48 |
|
120 | | -For more examples, see the Documentation section below. |
| 49 | + phone_number = 'phone_number' |
| 50 | + message = 'You\'re scheduled for a dentist appointment at 2:30PM.' |
| 51 | + message_type = 'ARN' |
121 | 52 |
|
122 | | -Authentication |
123 | | -------------- |
| 53 | + messaging_client = Telesign::MessagingClient.new(customer_id, secret_key) |
| 54 | + response = messaging_client.message(phone_number, message, message_type) |
124 | 55 |
|
125 | | -You will need a Customer ID and API Key in order to use TeleSign’s REST API. If you are already a customer and need an API Key, you can generate one in `TelePortal <https://teleportal.telesign.com>`_. If you are not a customer and would like to get an API Key, please contact `support@telesign.com <mailto:support@telesign.com>`_ |
| 56 | +.. code-block:: javascript |
| 57 | +
|
| 58 | + {"reference_id"=>"B56A497C9A74016489525132F8840634", |
| 59 | + "status"=> |
| 60 | + {"updated_on"=>"2017-03-03T04:13:14.028347Z", |
| 61 | + "code"=>103, |
| 62 | + "description"=>"Call in progress"}} |
| 63 | +
|
| 64 | +For more examples, see the examples folder or visit `TeleSign Developer Portal <https://developer.telesign.com/>`_. |
| 65 | + |
| 66 | +Authentication |
| 67 | +-------------- |
126 | 68 |
|
| 69 | +You will need a Customer ID and API Key in order to use TeleSign’s REST API. If you are already a customer and need an |
| 70 | +API Key, you can generate one in the `Portal <https://portal.telesign.com>`_. |
127 | 71 |
|
128 | | -Support and Feedback |
129 | | --------------------- |
| 72 | +Testing |
| 73 | +------- |
130 | 74 |
|
131 | | -For more information about the Phone Verify and PhoneID Standard services, please contact your TeleSign representative: |
| 75 | +To run the Ruby SDK test suite: |
132 | 76 |
|
133 | | -Email: `support@telesign.com <mailto:support@telesign.com>`_ |
| 77 | +.. code-block:: bash |
134 | 78 |
|
135 | | -Phone: +1 310 740 9700 |
| 79 | + $ rake test |
0 commit comments