Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 5 commits
  • 1,011 files changed
  • 0 commit comments
  • 1 contributor
Showing with 0 additions and 16,956 deletions.
  1. BIN  DC/.DS_Store
  2. +0 −109 DC/Csharp/app1/Default.aspx
  3. +0 −585 DC/Csharp/app1/Default.aspx.cs
  4. +0 −80 DC/Csharp/app1/README.txt
  5. +0 −39 DC/Csharp/app1/Web.config
  6. BIN  DC/Csharp/app1/images/att.gif
  7. +0 −39 DC/Csharp/app1/style/common.css
  8. BIN  DC/Java/.DS_Store
  9. BIN  DC/Java/app1/.DS_Store
  10. +0 −213 DC/Java/app1/DC.jsp
  11. +0 −3  DC/Java/app1/META-INF/MANIFEST.MF
  12. +0 −81 DC/Java/app1/README.txt
  13. BIN  DC/Java/app1/WEB-INF/.DS_Store
  14. BIN  DC/Java/app1/WEB-INF/lib/.DS_Store
  15. BIN  DC/Java/app1/WEB-INF/lib/commons-codec-1.5.jar
  16. BIN  DC/Java/app1/WEB-INF/lib/commons-httpclient-3.0.1.jar
  17. BIN  DC/Java/app1/WEB-INF/lib/commons-io-1.4.jar
  18. BIN  DC/Java/app1/WEB-INF/lib/commons-logging-1.1.1.jar
  19. BIN  DC/Java/app1/WEB-INF/lib/json-rpc-1.0.jar
  20. +0 −5 DC/Java/app1/config.jsp
  21. BIN  DC/Java/app1/images/att.gif
  22. +0 −172 DC/Java/app1/oauth.jsp
  23. +0 −39 DC/Java/app1/style/common.css
  24. BIN  DC/PHP/.DS_Store
  25. BIN  DC/PHP/app1/.DS_Store
  26. +0 −69 DC/PHP/app1/README.txt
  27. +0 −39 DC/PHP/app1/common.css
  28. +0 −16 DC/PHP/app1/config.php
  29. BIN  DC/PHP/app1/images/att.gif
  30. +0 −275 DC/PHP/app1/index.php
  31. BIN  DC/Ruby/.DS_Store
  32. BIN  DC/Ruby/app1/.DS_Store
  33. +0 −112 DC/Ruby/app1/README
  34. +0 −52 DC/Ruby/app1/common.rb
  35. +0 −6 DC/Ruby/app1/config.yml
  36. +0 −80 DC/Ruby/app1/dc.rb
  37. BIN  DC/Ruby/app1/public/images/att.gif
  38. +0 −39 DC/Ruby/app1/public/style/common.css
  39. +0 −125 DC/Ruby/app1/views/dc.erb
  40. +0 −109 DC/Vb/app1/Default.aspx
  41. +0 −587 DC/Vb/app1/Default.aspx.vb
  42. +0 −80 DC/Vb/app1/README.txt
  43. +0 −39 DC/Vb/app1/Web.config
  44. BIN  DC/Vb/app1/images/att.gif
  45. +0 −39 DC/Vb/app1/style/common.css
  46. +0 −233 MIM/Csharp/app1/Default.aspx
  47. +0 −1,105 MIM/Csharp/app1/Default.aspx.cs
  48. +0 −35 MIM/Csharp/app1/MSRestfulV2_1_CsharpMIMApp1.sln
  49. +0 −102 MIM/Csharp/app1/README.txt
  50. +0 −37 MIM/Csharp/app1/Web.config
  51. BIN  MIM/Csharp/app1/images/Thumbs.db
  52. BIN  MIM/Csharp/app1/images/att.gif
  53. +0 −39 MIM/Csharp/app1/style/common.css
  54. +0 −3  MIM/Java/app1/META-INF/MANIFEST.MF
  55. +0 −531 MIM/Java/app1/MIM.jsp
  56. +0 −89 MIM/Java/app1/README.txt
  57. BIN  MIM/Java/app1/WEB-INF/.DS_Store
  58. BIN  MIM/Java/app1/WEB-INF/classes/com/att/rest/HttpMethod.class
  59. +0 −11 MIM/Java/app1/WEB-INF/classes/com/att/rest/HttpMethod.java
  60. BIN  MIM/Java/app1/WEB-INF/classes/com/att/rest/RestClient.class
  61. +0 −157 MIM/Java/app1/WEB-INF/classes/com/att/rest/RestClient.java
  62. BIN  MIM/Java/app1/WEB-INF/lib/.DS_Store
  63. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-benchmark-0.7.2-javadoc.jar
  64. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-benchmark-0.7.2-sources.jar
  65. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-benchmark-0.7.2.jar
  66. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-core-0.7.2-javadoc.jar
  67. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-core-0.7.2-sources.jar
  68. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-core-0.7.2-tests.jar
  69. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-core-0.7.2.jar
  70. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-dom-0.7.2-javadoc.jar
  71. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-dom-0.7.2-sources.jar
  72. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-dom-0.7.2.jar
  73. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-examples-0.7.2-javadoc.jar
  74. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-examples-0.7.2-sources.jar
  75. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-examples-0.7.2.jar
  76. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-storage-0.7.2-javadoc.jar
  77. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-storage-0.7.2-sources.jar
  78. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-storage-0.7.2-tests.jar
  79. BIN  MIM/Java/app1/WEB-INF/lib/apache-mime4j-storage-0.7.2.jar
  80. BIN  MIM/Java/app1/WEB-INF/lib/commons-codec-1.4.jar
  81. BIN  MIM/Java/app1/WEB-INF/lib/commons-codec-1.5.jar
  82. BIN  MIM/Java/app1/WEB-INF/lib/commons-fileupload-1.2.2.jar
  83. BIN  MIM/Java/app1/WEB-INF/lib/commons-httpclient-3.0.1.jar
  84. BIN  MIM/Java/app1/WEB-INF/lib/commons-io-1.4.jar
  85. BIN  MIM/Java/app1/WEB-INF/lib/commons-io-2.3.jar
  86. BIN  MIM/Java/app1/WEB-INF/lib/commons-logging-1.1.1.jar
  87. BIN  MIM/Java/app1/WEB-INF/lib/httpclient-4.1.2.jar
  88. BIN  MIM/Java/app1/WEB-INF/lib/httpclient-cache-4.1.2.jar
  89. BIN  MIM/Java/app1/WEB-INF/lib/httpcore-4.1.2.jar
  90. BIN  MIM/Java/app1/WEB-INF/lib/httpcore-4.2.1.jar
  91. BIN  MIM/Java/app1/WEB-INF/lib/httpcore-ab-4.2.1.jar
  92. BIN  MIM/Java/app1/WEB-INF/lib/httpcore-nio-4.2.1.jar
  93. BIN  MIM/Java/app1/WEB-INF/lib/httpmime-4.1.2.jar
  94. BIN  MIM/Java/app1/WEB-INF/lib/jersey-client.jar
  95. BIN  MIM/Java/app1/WEB-INF/lib/jersey-core.jar
  96. BIN  MIM/Java/app1/WEB-INF/lib/jersey-multipart.jar
  97. BIN  MIM/Java/app1/WEB-INF/lib/json-rpc-1.0.jar
  98. +0 −14 MIM/Java/app1/config.jsp
  99. BIN  MIM/Java/app1/images/.DS_Store
  100. BIN  MIM/Java/app1/images/att.gif
  101. +0 −172 MIM/Java/app1/oauth.jsp
  102. +0 −39 MIM/Java/app1/style/common.css
  103. +0 −96 MIM/PHP/app1/README.txt
  104. +0 −14 MIM/PHP/app1/config.php
  105. +0 −41 MIM/PHP/app1/images/.svn/entries
  106. +0 −1  MIM/PHP/app1/images/.svn/format
  107. +0 −5 MIM/PHP/app1/images/.svn/prop-base/att.gif.svn-base
  108. BIN  MIM/PHP/app1/images/.svn/text-base/att.gif.svn-base
  109. BIN  MIM/PHP/app1/images/att.gif
  110. +0 −531 MIM/PHP/app1/index.php
  111. +0 −40 MIM/PHP/app1/style/.svn/entries
  112. +0 −1  MIM/PHP/app1/style/.svn/format
  113. +0 −39 MIM/PHP/app1/style/.svn/text-base/common.css.svn-base
  114. +0 −39 MIM/PHP/app1/style/common.css
  115. +0 −117 MIM/Ruby/app1/README
  116. +0 −62 MIM/Ruby/app1/common.rb
  117. +0 −5 MIM/Ruby/app1/config.yml
  118. +0 −113 MIM/Ruby/app1/mim.rb
  119. BIN  MIM/Ruby/app1/public/images/att.gif
  120. +0 −39 MIM/Ruby/app1/public/style/common.css
  121. +0 −342 MIM/Ruby/app1/views/mim.erb
  122. +0 −232 MIM/Vb/app1/Default.aspx
  123. +0 −1,050 MIM/Vb/app1/Default.aspx.vb
  124. +0 −35 MIM/Vb/app1/MSRestfulV2_1_VbMIMApp1.sln
  125. +0 −102 MIM/Vb/app1/README.txt
  126. +0 −37 MIM/Vb/app1/Web.config
  127. BIN  MIM/Vb/app1/images/Thumbs.db
  128. BIN  MIM/Vb/app1/images/att.gif
  129. +0 −39 MIM/Vb/app1/style/common.css
  130. BIN  MMS/.DS_Store
  131. +0 −191 MMS/Csharp/app1/Default.aspx
  132. +0 −1,173 MMS/Csharp/app1/Default.aspx.cs
  133. +0 −35 MMS/Csharp/app1/MSRestfulV2_1_CsharpMMSApp1.sln
  134. +0 −109 MMS/Csharp/app1/README.txt
  135. +0 −46 MMS/Csharp/app1/Web.config
  136. BIN  MMS/Csharp/app1/images/Thumbs.db
  137. BIN  MMS/Csharp/app1/images/att.gif
  138. +0 −39 MMS/Csharp/app1/style/common.css
  139. +0 −159 MMS/Csharp/app2/Default.aspx
  140. +0 −1,120 MMS/Csharp/app2/Default.aspx.cs
  141. +0 −35 MMS/Csharp/app2/MSRestfulV2_1_CsharpMMSApp2.sln
  142. +0 −129 MMS/Csharp/app2/README.txt
  143. +0 −69 MMS/Csharp/app2/Web.config
  144. BIN  MMS/Csharp/app2/coupon_info/coupon.jpg
  145. +0 −1  MMS/Csharp/app2/coupon_info/message.txt
  146. 0  MMS/Csharp/app2/coupon_info/phone.txt
  147. BIN  MMS/Csharp/app2/images/Thumbs.db
  148. BIN  MMS/Csharp/app2/images/att.gif
  149. +0 −39 MMS/Csharp/app2/style/common.css
  150. +0 −92 MMS/Csharp/app3/Default.aspx
  151. +0 −194 MMS/Csharp/app3/Default.aspx.cs
  152. +0 −23 MMS/Csharp/app3/Listener.aspx
  153. +0 −85 MMS/Csharp/app3/Listener.aspx.cs
  154. +0 −35 MMS/Csharp/app3/MSRestfulV2_1_CsharpMMSApp3.sln
  155. +0 −96 MMS/Csharp/app3/README.txt
  156. +0 −28 MMS/Csharp/app3/Web.config
  157. BIN  MMS/Csharp/app3/images/Thumbs.db
  158. BIN  MMS/Csharp/app3/images/att.gif
  159. +0 −39 MMS/Csharp/app3/style/common.css
  160. BIN  MMS/Java/.DS_Store
  161. BIN  MMS/Java/app1/.DS_Store
  162. +0 −3  MMS/Java/app1/META-INF/MANIFEST.MF
  163. +0 −410 MMS/Java/app1/MMS.jsp
  164. +0 −13 MMS/Java/app1/OauthStorage.jsp
  165. +0 −84 MMS/Java/app1/README.txt
  166. BIN  MMS/Java/app1/WEB-INF/.DS_Store
  167. BIN  MMS/Java/app1/WEB-INF/classes/com/att/rest/HttpMethod.class
  168. +0 −11 MMS/Java/app1/WEB-INF/classes/com/att/rest/HttpMethod.java
  169. BIN  MMS/Java/app1/WEB-INF/classes/com/att/rest/RestClient.class
  170. +0 −157 MMS/Java/app1/WEB-INF/classes/com/att/rest/RestClient.java
  171. BIN  MMS/Java/app1/WEB-INF/lib/.DS_Store
  172. BIN  MMS/Java/app1/WEB-INF/lib/commons-codec-1.5.jar
  173. BIN  MMS/Java/app1/WEB-INF/lib/commons-fileupload-1.2.2.jar
  174. BIN  MMS/Java/app1/WEB-INF/lib/commons-httpclient-3.0.1.jar
  175. BIN  MMS/Java/app1/WEB-INF/lib/commons-io-1.4.jar
  176. BIN  MMS/Java/app1/WEB-INF/lib/commons-logging-1.1.1.jar
  177. BIN  MMS/Java/app1/WEB-INF/lib/jersey-client.jar
  178. BIN  MMS/Java/app1/WEB-INF/lib/jersey-core.jar
  179. BIN  MMS/Java/app1/WEB-INF/lib/jersey-multipart.jar
  180. BIN  MMS/Java/app1/WEB-INF/lib/json-rpc-1.0.jar
  181. +0 −13 MMS/Java/app1/config.jsp
  182. +0 −78 MMS/Java/app1/getToken.jsp
  183. BIN  MMS/Java/app1/images/.DS_Store
  184. BIN  MMS/Java/app1/images/att.gif
  185. +0 −39 MMS/Java/app1/style/common.css
  186. BIN  MMS/Java/app2/.DS_Store
  187. +0 −3  MMS/Java/app2/META-INF/MANIFEST.MF
  188. +0 −342 MMS/Java/app2/MMS2.jsp
  189. +0 −13 MMS/Java/app2/OauthStorage.jsp
  190. +0 −83 MMS/Java/app2/README.txt
  191. BIN  MMS/Java/app2/WEB-INF/.DS_Store
  192. BIN  MMS/Java/app2/WEB-INF/classes/com/att/rest/HttpMethod.class
  193. +0 −11 MMS/Java/app2/WEB-INF/classes/com/att/rest/HttpMethod.java
  194. BIN  MMS/Java/app2/WEB-INF/classes/com/att/rest/RestClient.class
  195. +0 −157 MMS/Java/app2/WEB-INF/classes/com/att/rest/RestClient.java
  196. BIN  MMS/Java/app2/WEB-INF/coupon.jpg
  197. BIN  MMS/Java/app2/WEB-INF/lib/commons-codec-1.5.jar
  198. BIN  MMS/Java/app2/WEB-INF/lib/commons-fileupload-1.2.2.jar
  199. BIN  MMS/Java/app2/WEB-INF/lib/commons-httpclient-3.0.1.jar
  200. BIN  MMS/Java/app2/WEB-INF/lib/commons-io-1.4.jar
  201. BIN  MMS/Java/app2/WEB-INF/lib/commons-logging-1.1.1.jar
  202. BIN  MMS/Java/app2/WEB-INF/lib/jersey-client.jar
  203. BIN  MMS/Java/app2/WEB-INF/lib/jersey-core.jar
  204. BIN  MMS/Java/app2/WEB-INF/lib/jersey-multipart.jar
  205. BIN  MMS/Java/app2/WEB-INF/lib/json-rpc-1.0.jar
  206. +0 −3  MMS/Java/app2/WEB-INF/phones.txt
  207. +0 −13 MMS/Java/app2/config.jsp
  208. BIN  MMS/Java/app2/coupon.jpg
  209. +0 −78 MMS/Java/app2/getToken.jsp
  210. BIN  MMS/Java/app2/images/.DS_Store
  211. BIN  MMS/Java/app2/images/att.gif
  212. +0 −1  MMS/Java/app2/message.txt
  213. +0 −1  MMS/Java/app2/phones.txt
  214. +0 −39 MMS/Java/app2/style/common.css
  215. BIN  MMS/Java/app3/.DS_Store
  216. +0 −3  MMS/Java/app3/META-INF/MANIFEST.MF
  217. +0 −109 MMS/Java/app3/MMS3.jsp
  218. 0  MMS/Java/app3/MoMmsData/sample.jpg.txt
  219. BIN  MMS/Java/app3/MoMmsImages/sample.jpg
  220. +0 −13 MMS/Java/app3/OauthStorage.jsp
  221. +0 −98 MMS/Java/app3/README.txt
  222. BIN  MMS/Java/app3/WEB-INF/.DS_Store
  223. BIN  MMS/Java/app3/WEB-INF/lib/.DS_Store
  224. BIN  MMS/Java/app3/WEB-INF/lib/commons-codec-1.5.jar
  225. BIN  MMS/Java/app3/WEB-INF/lib/commons-fileupload-1.2.2.jar
  226. BIN  MMS/Java/app3/WEB-INF/lib/commons-httpclient-3.0.1.jar
  227. BIN  MMS/Java/app3/WEB-INF/lib/commons-io-1.4.jar
  228. BIN  MMS/Java/app3/WEB-INF/lib/commons-logging-1.1.1.jar
  229. BIN  MMS/Java/app3/WEB-INF/lib/json-rpc-1.0.jar
  230. +0 −14 MMS/Java/app3/config.jsp
  231. +0 −47 MMS/Java/app3/getImageData.jsp
  232. BIN  MMS/Java/app3/images/att.gif
  233. +0 −77 MMS/Java/app3/mmslistener.jsp
  234. +0 −39 MMS/Java/app3/style/common.css
  235. BIN  MMS/PHP/.DS_Store
  236. BIN  MMS/PHP/app1/.DS_Store
  237. +0 −67 MMS/PHP/app1/README.txt
  238. +0 −39 MMS/PHP/app1/common.css
  239. +0 −18 MMS/PHP/app1/config.php
  240. BIN  MMS/PHP/app1/images/att.gif
  241. +0 −528 MMS/PHP/app1/index.php
  242. BIN  MMS/PHP/app2/.DS_Store
  243. +0 −72 MMS/PHP/app2/README.txt
  244. +0 −39 MMS/PHP/app2/common.css
  245. +0 −16 MMS/PHP/app2/config.php
  246. BIN  MMS/PHP/app2/coupon.jpg
  247. BIN  MMS/PHP/app2/images/att.gif
  248. +0 −536 MMS/PHP/app2/index.php
  249. BIN  MMS/PHP/app3/.DS_Store
  250. +0 −15 MMS/PHP/app3/MoMessages/0/0.smil
  251. BIN  MMS/PHP/app3/MoMessages/0/IMG_2500.png
  252. +0 −1  MMS/PHP/app3/MoMessages/0/text_0002.txt
  253. +0 −15 MMS/PHP/app3/MoMessages/1/0.smil
  254. BIN  MMS/PHP/app3/MoMessages/1/IMG_2500.png
  255. +0 −1  MMS/PHP/app3/MoMessages/1/text_0002.txt
  256. +0 −15 MMS/PHP/app3/MoMessages/2/0.smil
  257. BIN  MMS/PHP/app3/MoMessages/2/IMG_2500.png
  258. +0 −1  MMS/PHP/app3/MoMessages/2/text_0002.txt
  259. +0 −15 MMS/PHP/app3/MoMessages/3/0.smil
  260. BIN  MMS/PHP/app3/MoMessages/3/IMG_2500.png
  261. +0 −1  MMS/PHP/app3/MoMessages/3/text_0002.txt
  262. +0 −15 MMS/PHP/app3/MoMessages/4/0.smil
  263. BIN  MMS/PHP/app3/MoMessages/4/IMG_2500.png
  264. +0 −1  MMS/PHP/app3/MoMessages/4/text_0002.txt
  265. +0 −15 MMS/PHP/app3/MoMessages/5/0.smil
  266. BIN  MMS/PHP/app3/MoMessages/5/IMG_2500.png
  267. +0 −1  MMS/PHP/app3/MoMessages/5/text_0002.txt
  268. +0 −15 MMS/PHP/app3/MoMessages/6/0.smil
  269. BIN  MMS/PHP/app3/MoMessages/6/IMG_2500.png
  270. +0 −1  MMS/PHP/app3/MoMessages/6/text_0002.txt
  271. +0 −15 MMS/PHP/app3/MoMessages/7/0.smil
  272. BIN  MMS/PHP/app3/MoMessages/7/IMG_2500.png
  273. +0 −1  MMS/PHP/app3/MoMessages/7/text_0002.txt
  274. +0 −15 MMS/PHP/app3/MoMessages/8/0.smil
  275. BIN  MMS/PHP/app3/MoMessages/8/IMG_2500.png
  276. +0 −1  MMS/PHP/app3/MoMessages/8/text_0002.txt
  277. 0  MMS/PHP/app3/MoMessages/mmslistner.db
  278. +0 −61 MMS/PHP/app3/README.txt
  279. +0 −39 MMS/PHP/app3/common.css
  280. +0 −10 MMS/PHP/app3/config.php
  281. +0 −37 MMS/PHP/app3/filed.php
  282. BIN  MMS/PHP/app3/images/att.gif
  283. +0 −108 MMS/PHP/app3/index.php
  284. +0 −105 MMS/PHP/app3/mmslistener.php
  285. BIN  MMS/Ruby/.DS_Store
  286. BIN  MMS/Ruby/app1/.DS_Store
  287. +0 −118 MMS/Ruby/app1/README
  288. +0 −48 MMS/Ruby/app1/common.rb
  289. +0 −7 MMS/Ruby/app1/config.yml
  290. +0 −120 MMS/Ruby/app1/mms.rb
  291. +0 −39 MMS/Ruby/app1/public/css/common.css
  292. BIN  MMS/Ruby/app1/public/images/att.gif
  293. +0 −194 MMS/Ruby/app1/views/mms.erb
  294. BIN  MMS/Ruby/app2/.DS_Store
  295. +0 −120 MMS/Ruby/app2/README
  296. +0 −57 MMS/Ruby/app2/common.rb
  297. +0 −8 MMS/Ruby/app2/config.yml
  298. +0 −157 MMS/Ruby/app2/mms2.rb
  299. +0 −1  MMS/Ruby/app2/phones.txt
  300. BIN  MMS/Ruby/app2/public/images/att.gif
Sorry, we could not display the entire diff because too many files (1,011) changed.
View
BIN  DC/.DS_Store
Binary file not shown
View
109 DC/Csharp/app1/Default.aspx
@@ -1,109 +0,0 @@
-<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en"><head>
- <title>AT&T Sample DC Application – Get Device Capabilities Application</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"/>
- <link rel="stylesheet" type="text/css" href="../../style/common.css"/>
- <style type="text/css">
- .style1
- {
- font-style: normal;
- font-variant: normal;
- font-weight: bold;
- font-size: 12px;
- line-height: normal;
- font-family: Arial, Sans-serif;
- width: 92px;
- }
- </style>
- </head>
-<body>
-<div id="container">
-<!-- open HEADER --><div id="header">
-<div>
- <div id="hcLeft">Server Time:</div>
- <div id="hcRight">
- <asp:Label ID="serverTimeLabel" runat="server" Text="Label"></asp:Label>
- </div>
- </div>
-<div>
- <div id="hcLeft">Client Time:</div>
- <div id="hcRight">
- <script language="JavaScript" type="text/javascript">
- var myDate = new Date();
- document.write(myDate);
- </script>
- </div>
-</div>
-<div>
- <div id="hcLeft">User Agent:</div>
- <div id="hcRight">
- <script language="JavaScript" type="text/javascript">
- document.write("" + navigator.userAgent);
- </script>
- </div>
-</div>
-
-<br clear="all" />
-</div><!-- close HEADER -->
-
-<div id="wrapper">
-<div id="content">
-
-<h1>AT&T Sample DC Application – Get Device Capabilities Application</h1>
-<h2>Feature 1: Get Device Capabilities</h2>
-
-</div>
-</div>
-<br clear="all" />
-<form id="form1" runat="server">
-<div id="navigation">
-<table border="0" width="100%">
- <tbody>
- <tr>
- <td width="20%" valign="top" class="label">Phone:</td>
- <td class="cell">
- <asp:TextBox ID="dcPhoneNumberTextBox" runat="server" MaxLength="16"></asp:TextBox>
- </td>
- </tr>
- </tbody></table>
-
-</div>
-<div id="extra">
-
-<table border="0" width="100%">
- <tbody>
- <tr>
- <td class="cell">
- <asp:Button ID="getDCCapabilities" runat="server"
- Text="Get Device Capabilities" onclick="getDCCapabilities_Click" /></button>
- </td>
- </tr>
- </tbody></table>
-
-</div>
-<br clear="all" />
-<div align="center">
- <asp:Panel ID="dcPanel" runat="server" Font-Names="Calibri">
- </asp:Panel>
-</div>
-<br clear="all" />
-</form>
-
-
-
-<div id="footer">
-
- <div style="float: right; width: 20%; font-size: 9px; text-align: right">Powered by AT&amp;T Virtual Mobile</div>
- <p>© 2011 AT&amp;T Intellectual Property. All rights reserved. <a href="http://developer.att.com/" target="_blank">http://developer.att.com</a>
-<br>
-The Application hosted on this site are working examples intended to be used for reference in creating products to consume AT&amp;T Services and not meant to be used as part of your product. The data in these pages is for test purposes only and intended only for use as a reference in how the services perform.
-<br>
-For download of tools and documentation, please go to <a href="https://devconnect-api.att.com/" target="_blank">https://devconnect-api.att.com</a>
-<br>
-For more information contact <a href="mailto:developer.support@att.com">developer.support@att.com</a>
-
-</div>
-</div>
-
-</body></html>
View
585 DC/Csharp/app1/Default.aspx.cs
@@ -1,585 +0,0 @@
-//Licensed by AT&T under 'Software Development Kit Tools Agreement.' September 2011
-//TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
-//Copyright 2011 AT&T Intellectual Property. All rights reserved. http://developer.att.com
-//For more information contact developer.support@att.com
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-using System.Net;
-using System.Configuration;
-using System.IO;
-using System.Xml;
-using System.Text;
-using System.Web.Script.Serialization;
-using System.Drawing;
-using System.Net.Security;
-using System.Security.Cryptography.X509Certificates;
-
-public partial class Default : System.Web.UI.Page
-{
- string FQDN;
- string api_key, secret_key, auth_code, access_token, authorize_redirect_uri, scope, expiryMilliSeconds, refresh_token, lastTokenTakenTime, refreshTokenExpiryTime;
- Table getStatusTable;
-
- /* This function reads access token related session variables to local variables */
- public void readTokenSessionVariables()
- {
- if (Session["dc_session_access_token"] != null)
- access_token = Session["dc_session_access_token"].ToString();
- else
- access_token = null;
- if (Session["dc_session_expiryMilliSeconds"] != null)
- expiryMilliSeconds = Session["dc_session_expiryMilliSeconds"].ToString();
- else
- expiryMilliSeconds = null;
- if (Session["dc_session_refresh_token"] != null)
- refresh_token = Session["dc_session_refresh_token"].ToString();
- else
- refresh_token = null;
- if (Session["dc_session_lastTokenTakenTime"] != null)
- lastTokenTakenTime = Session["dc_session_lastTokenTakenTime"].ToString();
- else
- lastTokenTakenTime = null;
- if (Session["dc_session_refreshTokenExpiryTime"] != null)
- refreshTokenExpiryTime = Session["dc_session_refreshTokenExpiryTime"].ToString();
- else
- refreshTokenExpiryTime = null;
- }
-
- /* This function resets access token related session variable to null */
- public void resetTokenSessionVariables()
- {
- Session["dc_session_access_token"] = null;
- Session["dc_session_expiryMilliSeconds"] = null;
- Session["dc_session_refresh_token"] = null;
- Session["dc_session_lastTokenTakenTime"] = null;
- Session["dc_session_refreshTokenExpiryTime"] = null;
- }
- /* This function resets access token related variable to null */
- public void resetTokenVariables()
- {
- access_token = null;
- expiryMilliSeconds = null;
- refresh_token = null;
- lastTokenTakenTime = null;
- refreshTokenExpiryTime = null;
- }
-
- /* This function validates access token related variables and returns VALID_ACCESS_TOKEN if its valid
- * otherwise, returns INVALID_ACCESS_TOKEN if refresh token expired or not able to read session variables
- * return REFRESH_TOKEN, if access token in expired and refresh token is valid
- */
- public string isTokenValid()
- {
- try
- {
- if (Session["dc_session_access_token"] == null)
- return "INVALID_ACCESS_TOKEN";
- DateTime currentServerTime = DateTime.UtcNow.ToLocalTime();
- DateTime lastRefreshTokenTime = DateTime.Parse(refreshTokenExpiryTime);
- TimeSpan refreshSpan = currentServerTime.Subtract(lastRefreshTokenTime);
- if (currentServerTime >= lastRefreshTokenTime)
- {
- return "INVALID_ACCESS_TOKEN";
- }
- DateTime lastTokenTime = DateTime.Parse(lastTokenTakenTime);
- TimeSpan tokenSpan = currentServerTime.Subtract(lastTokenTime);
- if (((tokenSpan.TotalSeconds)) > Convert.ToInt32(expiryMilliSeconds))
- {
- return "REFRESH_TOKEN";
- }
- else
- {
- return "VALID_ACCESS_TOKEN";
- }
- }
- catch (Exception ex)
- {
- return "INVALID_ACCESS_TOKEN";
- }
- }
-
- /* This function is used to neglect the ssl handshake error with authentication server */
- public static void BypassCertificateError()
- {
- ServicePointManager.ServerCertificateValidationCallback +=
- delegate(Object sender1, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
- {
- return true;
- };
- }
-
- /* This function redirects to authentication server to get the access code */
- public void getAuthCode()
- {
- try
- {
- Response.Redirect("" + FQDN + "/oauth/authorize?scope=" + scope + "&client_id=" + api_key + "&redirect_url=" + authorize_redirect_uri);
- }
- catch (Exception ex)
- {
- drawPanelForFailure(dcPanel, ex.ToString());
- }
- }
-
- /* This function get the access token based on the type parameter type values.
- * If type value is 0, access token is fetch for authorization code flow
- * If type value is 2, access token is fetch for authorization code floww based on the exisiting refresh token
- */
- public bool getAccessToken(int type)
- {
- if (type == 0)
- {
- try
- {
- DateTime currentServerTime = DateTime.UtcNow.ToLocalTime();
- WebRequest accessTokenRequest = System.Net.HttpWebRequest.Create("" + FQDN + "/oauth/token");
- accessTokenRequest.Method = "POST";
- string oauthParameters = "client_id=" + api_key.ToString() + "&client_secret=" + secret_key.ToString() + "&code=" + auth_code.ToString() + "&grant_type=authorization_code";
- accessTokenRequest.ContentType = "application/x-www-form-urlencoded";
- //sendSmsRequestObject.Accept = "application/json";
- UTF8Encoding encoding = new UTF8Encoding();
- byte[] postBytes = encoding.GetBytes(oauthParameters);
- accessTokenRequest.ContentLength = postBytes.Length;
- Stream postStream = accessTokenRequest.GetRequestStream();
- postStream.Write(postBytes, 0, postBytes.Length);
- postStream.Close();
-
- WebResponse accessTokenResponse = accessTokenRequest.GetResponse();
- using (StreamReader accessTokenResponseStream = new StreamReader(accessTokenResponse.GetResponseStream()))
- {
- string access_token_json = accessTokenResponseStream.ReadToEnd().ToString();
- JavaScriptSerializer deserializeJsonObject = new JavaScriptSerializer();
- AccessTokenResponse deserializedJsonObj = (AccessTokenResponse)deserializeJsonObject.Deserialize(access_token_json, typeof(AccessTokenResponse));
- if (deserializedJsonObj.access_token != null)
- {
- access_token = deserializedJsonObj.access_token.ToString();
- expiryMilliSeconds = deserializedJsonObj.expires_in.ToString();
- refresh_token = deserializedJsonObj.refresh_token.ToString();
- lastTokenTakenTime = currentServerTime.ToLongDateString() + " " + currentServerTime.ToLongTimeString();
- DateTime refreshExpiry = currentServerTime.AddHours(24);
- refreshTokenExpiryTime = refreshExpiry.ToLongDateString() + " " + refreshExpiry.ToLongTimeString();
- Session["dc_session_access_token"] = access_token.ToString();
- Session["dc_session_expiryMilliSeconds"] = expiryMilliSeconds.ToString();
- Session["dc_session_refresh_token"] = refresh_token.ToString();
- Session["dc_session_lastTokenTakenTime"] = lastTokenTakenTime.ToString();
- Session["dc_session_refreshTokenExpiryTime"] = refreshTokenExpiryTime.ToString();
- accessTokenResponseStream.Close();
- return true;
- }
- else
- {
- drawPanelForFailure(dcPanel, "Auth server returned null access token");
- return false;
-
- }
- }
- }
- catch (Exception ex)
- {
- drawPanelForFailure(dcPanel, ex.ToString());
- return false;
- }
- }
- else if (type == 2)
- {
- try
- {
- DateTime currentServerTime = DateTime.UtcNow.ToLocalTime();
- WebRequest accessTokenRequest = System.Net.HttpWebRequest.Create("" + FQDN + "/oauth/token");
- accessTokenRequest.Method = "POST";
- string oauthParameters = "grant_type=refresh_token&client_id=" + api_key.ToString() + "&client_secret=" + secret_key.ToString() + "&refresh_token=" + refresh_token.ToString();
- accessTokenRequest.ContentType = "application/x-www-form-urlencoded";
- //sendSmsRequestObject.Accept = "application/json";
-
- UTF8Encoding encoding = new UTF8Encoding();
- byte[] postBytes = encoding.GetBytes(oauthParameters);
- accessTokenRequest.ContentLength = postBytes.Length;
-
- Stream postStream = accessTokenRequest.GetRequestStream();
- postStream.Write(postBytes, 0, postBytes.Length);
- postStream.Close();
- WebResponse accessTokenResponse = accessTokenRequest.GetResponse();
- using (StreamReader accessTokenResponseStream = new StreamReader(accessTokenResponse.GetResponseStream()))
- {
- string access_token_json = accessTokenResponseStream.ReadToEnd().ToString();
- JavaScriptSerializer deserializeJsonObject = new JavaScriptSerializer();
- AccessTokenResponse deserializedJsonObj = (AccessTokenResponse)deserializeJsonObject.Deserialize(access_token_json, typeof(AccessTokenResponse));
- if (deserializedJsonObj.access_token != null)
- {
- access_token = deserializedJsonObj.access_token.ToString();
- expiryMilliSeconds = deserializedJsonObj.expires_in.ToString();
- refresh_token = deserializedJsonObj.refresh_token.ToString();
- lastTokenTakenTime = currentServerTime.ToLongDateString() + " " + currentServerTime.ToLongTimeString();
- DateTime refreshExpiry = currentServerTime.AddHours(24);
- refreshTokenExpiryTime = refreshExpiry.ToLongDateString() + " " + refreshExpiry.ToLongTimeString();
- Session["dc_session_access_token"] = access_token.ToString();
- Session["dc_session_expiryMilliSeconds"] = expiryMilliSeconds.ToString();
- Session["dc_session_refresh_token"] = refresh_token.ToString();
- Session["dc_session_lastTokenTakenTime"] = lastTokenTakenTime.ToString();
- Session["dc_session_refreshTokenExpiryTime"] = refreshTokenExpiryTime.ToString();
- accessTokenResponseStream.Close();
- return true;
- }
- else
- {
- drawPanelForFailure(dcPanel, "Auth server returned null access token");
- return false;
- }
- }
- }
- catch (Exception ex)
- {
- drawPanelForFailure(dcPanel, ex.ToString());
- return false;
- }
- }
- return false;
- }
-
- /* This funciton draws table for error response */
- private void drawPanelForFailure(Panel panelParam, string message)
- {
- Table table = new Table();
- table.Font.Name = "Sans-serif";
- table.Font.Size = 9;
- table.BorderStyle = BorderStyle.Outset;
- table.Width = Unit.Pixel(650);
- TableRow rowOne = new TableRow();
- TableCell rowOneCellOne = new TableCell();
- rowOneCellOne.Font.Bold = true;
- rowOneCellOne.Text = "ERROR:";
- rowOne.Controls.Add(rowOneCellOne);
- //rowOneCellOne.BorderWidth = 1;
- table.Controls.Add(rowOne);
- TableRow rowTwo = new TableRow();
- TableCell rowTwoCellOne = new TableCell();
- //rowTwoCellOne.BorderWidth = 1;
- rowTwoCellOne.Text = message.ToString();
- rowTwo.Controls.Add(rowTwoCellOne);
- table.Controls.Add(rowTwo);
- table.BorderWidth = 2;
- table.BorderColor = Color.Red;
- table.BackColor = System.Drawing.ColorTranslator.FromHtml("#fcc");
- panelParam.Controls.Add(table);
- }
- /*
- * This function is called when the applicaiton page is loaded into the browser.
- * This fucntion reads the web.config and gets the values of the attributes
- *
- */
- protected void Page_Load(object sender, EventArgs e)
- {
- try
- {
- BypassCertificateError();
- DateTime currentServerTime = DateTime.UtcNow;
- serverTimeLabel.Text = String.Format("{0:ddd, MMM dd, yyyy HH:mm:ss}", currentServerTime) + " UTC";
- if (ConfigurationManager.AppSettings["FQDN"] == null)
- {
- drawPanelForFailure(dcPanel, "FQDN is not defined in configuration file");
- return;
- }
- FQDN = ConfigurationManager.AppSettings["FQDN"].ToString();
- if (ConfigurationManager.AppSettings["api_key"] == null)
- {
- drawPanelForFailure(dcPanel, "api_key is not defined in configuration file");
- return;
- }
- api_key = ConfigurationManager.AppSettings["api_key"].ToString();
- if (ConfigurationManager.AppSettings["secret_key"] == null)
- {
- drawPanelForFailure(dcPanel, "secret_key is not defined in configuration file");
- return;
- }
- secret_key = ConfigurationManager.AppSettings["secret_key"].ToString();
- if (ConfigurationManager.AppSettings["scope"] == null)
- {
- scope = "DC";
- }
- else
- {
- scope = ConfigurationManager.AppSettings["scope"].ToString();
- }
- if (ConfigurationManager.AppSettings["authorize_redirect_uri"] == null)
- {
- drawPanelForFailure(dcPanel, "authorize_redirect_uri is not defined in configuration file");
- return;
- }
- authorize_redirect_uri = ConfigurationManager.AppSettings["authorize_redirect_uri"].ToString();
- if ((Session["dc_session_appState"] != null) && (Request["Code"] != null))
- {
- auth_code = Request["code"].ToString();
- if (getAccessToken(0) == true)
- {
- readTokenSessionVariables();
- }
- else
- {
- drawPanelForFailure(dcPanel, "Failed to get Access token");
- resetTokenSessionVariables();
- resetTokenVariables();
- Session["dc_session_DeviceIdForWhichTokenAcquired"] = null;
- return;
- }
- }
- if (Session["dc_session_appState"] != null)
- {
- Session["dc_session_appState"] = null;
- if (Session["dc_session_GdeviceID"] != null)
- {
- Session["dc_session_DeviceIdForWhichTokenAcquired"] = Session["dc_session_GdeviceID"].ToString();
- Session["dc_session_GdeviceID"] = null;
- }
- dcPhoneNumberTextBox.Text = Session["dc_session_deviceID"].ToString();
- Session["dc_session_deviceID"] = null;
- getDCCapabilities_Click(null,null);
- }
- }
- catch (Exception ex)
- {
- drawPanelForFailure(dcPanel, ex.ToString());
- }
-
- }
- /*This funciton checks the validity of string as msisdn */
-
- private Boolean isValidMISDN(string number)
- {
- string smsAddressInput = number;
- long tryParseResult = 0;
- string smsAddressFormatted;
- string phoneStringPattern = "^\\d{3}-\\d{3}-\\d{4}$";
- if (System.Text.RegularExpressions.Regex.IsMatch(smsAddressInput, phoneStringPattern))
- {
- smsAddressFormatted = smsAddressInput.Replace("-", "");
- }
- else
- {
- smsAddressFormatted = smsAddressInput;
- }
- if (smsAddressFormatted.Length == 16 && smsAddressFormatted.StartsWith("tel:+1"))
- {
- smsAddressFormatted = smsAddressFormatted.Substring(6, 10);
- }
- else if (smsAddressFormatted.Length == 15 && smsAddressFormatted.StartsWith("tel:1"))
- {
- smsAddressFormatted = smsAddressFormatted.Substring(5, 10);
- }
- else if (smsAddressFormatted.Length == 14 && smsAddressFormatted.StartsWith("tel:"))
- {
- smsAddressFormatted = smsAddressFormatted.Substring(4, 10);
- }
- else if (smsAddressFormatted.Length == 12 && smsAddressFormatted.StartsWith("+1"))
- {
- smsAddressFormatted = smsAddressFormatted.Substring(2, 10);
- }
- else if (smsAddressFormatted.Length == 11 && smsAddressFormatted.StartsWith("1"))
- {
- smsAddressFormatted = smsAddressFormatted.Substring(1, 10);
- }
- if ((smsAddressFormatted.Length != 10) || (!long.TryParse(smsAddressFormatted, out tryParseResult)))
- {
- return false;
- }
- return true;
- }
-
- /*This method is used to draw table for successful response of get device capabilities */
-
- private void drawPanelForGetStatusResult(string attribute, string value, bool headerFlag)
- {
- if (headerFlag == true)
- {
- Table getStatusTableHeading = new Table();
- getStatusTableHeading.Font.Name = "Sans-serif";
- getStatusTableHeading.Font.Size = 9;
- getStatusTableHeading.BorderStyle = BorderStyle.Outset;
- getStatusTableHeading.Width = Unit.Pixel(650);
- TableRow one = new TableRow();
- TableCell cell = new TableCell();
- cell.Text = "SUCCESS:";
- cell.Font.Bold = true;
- one.Controls.Add(cell);
- TableRow two = new TableRow();
- cell = new TableCell();
- cell.Text = "Device parameters listed below";
- two.Controls.Add(cell);
- getStatusTableHeading.Controls.Add(one);
- getStatusTableHeading.Controls.Add(two);
- getStatusTableHeading.BorderWidth = 2;
- getStatusTableHeading.BorderColor = Color.DarkGreen;
- getStatusTableHeading.BackColor = System.Drawing.ColorTranslator.FromHtml("#cfc");
- getStatusTableHeading.Font.Size = 9;
- dcPanel.Controls.Add(getStatusTableHeading);
-
- getStatusTable = new Table();
- getStatusTable.Font.Size = 9;
- getStatusTable.Font.Name = "Sans-serif";
- getStatusTable.Font.Italic = true;
- //getStatusTable.HorizontalAlign = HorizontalAlign.Center;
- TableRow rowOne = new TableRow();
- TableCell rowOneCellOne = new TableCell();
- rowOneCellOne.Font.Bold = true;
- //rowOneCellOne.BorderWidth = 1;
- rowOneCellOne.Text = "Parameter";
- rowOneCellOne.HorizontalAlign = HorizontalAlign.Center;
- rowOne.Controls.Add(rowOneCellOne);
- TableCell rowOneCellTwo = new TableCell();
- rowOneCellTwo.Font.Bold = true;
- //rowOneCellTwo.BorderWidth = 1;
- rowOneCellTwo.Text = "Value";
- rowOneCellTwo.HorizontalAlign = HorizontalAlign.Center;
- rowOne.Controls.Add(rowOneCellTwo);
- //getStatusTable.BorderWidth = 2;
- //getStatusTable.BorderColor = Color.DarkGreen;
- //getStatusTable.BackColor = System.Drawing.ColorTranslator.FromHtml("#cfc");
- getStatusTable.Controls.Add(rowOne);
- dcPanel.Controls.Add(getStatusTable);
- }
- else
- {
- TableRow row = new TableRow();
- TableCell cell1 = new TableCell();
- TableCell cell2 = new TableCell();
- cell1.Text = attribute.ToString();
- //cell1.BorderWidth = 1;
- cell1.HorizontalAlign = HorizontalAlign.Center;
- row.Controls.Add(cell1);
- cell2.Text = value.ToString();
- //cell2.BorderWidth = 1;
- cell2.HorizontalAlign = HorizontalAlign.Center;
- row.Controls.Add(cell2);
- getStatusTable.Controls.Add(row);
- }
- }
- /*
- * User invoked Event to get device Information
- */
- protected void getDCCapabilities_Click(object sender, EventArgs e)
- {
- try
- {
- try
- {
- if (isValidMISDN(dcPhoneNumberTextBox.Text.ToString()) == false)
- {
- drawPanelForFailure(dcPanel,"Invalid Number");
- return;
- }
- string deviceId =dcPhoneNumberTextBox.Text.ToString().Replace("tel:+1", "");
- deviceId = deviceId.ToString().Replace("tel:+", "");
- deviceId = deviceId.ToString().Replace("tel:1", "");
- deviceId = deviceId.ToString().Replace("tel:", "");
- deviceId = deviceId.ToString().Replace("tel:", "");
- deviceId = deviceId.ToString().Replace("+1", "");
- deviceId = deviceId.ToString().Replace("-", "");
- if (deviceId.Length == 11)
- {
- deviceId = deviceId.Remove(0, 1);
- }
- String dcResponseData;
- readTokenSessionVariables();
- string tokentResult = isTokenValid();
- if (tokentResult.CompareTo("INVALID_ACCESS_TOKEN") == 0)
- {
- Session["dc_session_appState"] = "GetToken";
- Session["dc_session_deviceID"] = dcPhoneNumberTextBox.Text.ToString();
- Session["dc_session_GdeviceID"] = deviceId.ToString();
- getAuthCode();
- }
- else if (tokentResult.CompareTo("REFRESH_TOKEN") == 0)
- {
- if (getAccessToken(2) == true)
- {
- readTokenSessionVariables();
- }
- else
- {
- drawPanelForFailure(dcPanel, "Failed to get Access token");
- resetTokenSessionVariables();
- resetTokenVariables();
- Session["dc_session_DeviceIdForWhichTokenAcquired"] = null;
- return;
- }
- }
- if ((Session["dc_session_DeviceIdForWhichTokenAcquired"] != null) && (Session["dc_session_DeviceIdForWhichTokenAcquired"].ToString().CompareTo(deviceId.ToString()) != 0))
- {
- resetTokenSessionVariables();
- resetTokenVariables();
- Session["dc_session_appState"] = "GetToken";
- Session["dc_session_deviceID"] = dcPhoneNumberTextBox.Text.ToString();
- Session["dc_session_GdeviceID"] = deviceId.ToString();
- getAuthCode();
- }
- //readCheckVerifyAccessToken();
- // Form Http Web Request
- HttpWebRequest deviceInfoRequestObject = (HttpWebRequest)System.Net.WebRequest.Create("" + FQDN + "/1/devices/tel:" + deviceId.ToString() + "/info?access_token=" + access_token.ToString());
- deviceInfoRequestObject.Method = "GET";
-
- HttpWebResponse deviceInfoResponse = (HttpWebResponse)deviceInfoRequestObject.GetResponse();
- using (StreamReader deviceInfoResponseStream = new StreamReader(deviceInfoResponse.GetResponseStream()))
- {
- dcResponseData = deviceInfoResponseStream.ReadToEnd();
- JavaScriptSerializer deserializeJsonObject = new JavaScriptSerializer();
- DeviceCapabilities deserializedJsonObj = (DeviceCapabilities)deserializeJsonObject.Deserialize(dcResponseData, typeof(DeviceCapabilities));
- drawPanelForGetStatusResult("", "", true);
- drawPanelForGetStatusResult("acwmodel", deserializedJsonObj.deviceId.acwmodel.ToString(), false);
- drawPanelForGetStatusResult("acwdevcert", deserializedJsonObj.deviceId.acwdevcert.ToString(), false);
- drawPanelForGetStatusResult("acwrel", deserializedJsonObj.deviceId.acwrel.ToString(), false);
- drawPanelForGetStatusResult("acwvendor", deserializedJsonObj.deviceId.acwvendor.ToString(), false);
- drawPanelForGetStatusResult("acwaocr", deserializedJsonObj.capabilities.acwaocr.ToString(), false);
- drawPanelForGetStatusResult("acwav", deserializedJsonObj.capabilities.acwav.ToString(), false);
- drawPanelForGetStatusResult("acwcf", deserializedJsonObj.capabilities.acwcf.ToString(), false);
- drawPanelForGetStatusResult("acwtermtype", deserializedJsonObj.capabilities.acwtermtype.ToString(), false);
- //Session["DeviceIdForWhichTokenAcquired"] = deviceId.ToString();
- deviceInfoResponseStream.Close();
- }
- }
- catch (Exception ex)
- {
- drawPanelForFailure(dcPanel, ex.ToString());
- }
- }
- catch (Exception ex)
- {
- drawPanelForFailure(dcPanel, ex.ToString());
- }
- }
-
-}
-
-/* Below are data structures used for application */
-
-public class AccessTokenResponse
-{
- public string access_token;
- public string refresh_token;
- public string expires_in;
-}
-
-public class DeviceCapabilities
-{
- public DeviceId deviceId { get; set; }
- public Capabilities capabilities { get; set; }
-}
-
-public class DeviceId
-{
- public string acwdevcert { get; set; }
- public string acwrel { get; set; }
- public string acwmodel { get; set; }
- public string acwvendor { get; set; }
-}
-
-public class Capabilities
-{
- public string acwav { get; set; }
- public string acwaocr { get; set; }
- public string acwcf { get; set; }
- public string acwtermtype { get; set; }
-}
View
80 DC/Csharp/app1/README.txt
@@ -1,80 +0,0 @@
-
- AT&T API Samples - DC app 1
- ------------------------------
-
-This file describes how to set up, configure and run the C# Applications of the AT&T RESTFul sample applications.
-It covers all steps required to register the application on DevConnect and, based on the generated API keys and secrets,
-create and run one's own full-fledged sample applications.
-
- 1. Configuration
- 2. Installation
- 3. Parameters
- 4. Running the application
-
-
-1. Configuration
-
- Configuration consists of a few steps necessary to get an application registered on DevConnect with the proper services and
- endpoints, depending on the type of client-side application (autonomous/non-autonomous).
-
- To register an application, go to https://devconnect-api.att.com/ and login with your valid username and password.
- Next, choose "My Apps" from the bar at the top of the page and click the "Setup a New Application" button.
-
- Fill in the form, in particular all fields marked as "required".
-
- Be careful while filling in the "OAuth Redirect URL" field. It should contain the URL that the oAuth provider will redirect
- users to when he/she successfully authenticates and authorizes your application.
-
-NOTE: You MUST select Device capability in the list of services under field 'Services' in order to use this sample application code.
-
- Having your application registered, you will get back an important pair of data: an API key and Secret key. They are
- necessary to get your applications working with the AT&T HTML5 APIs. See 'Adjusting parameters' below to learn how to use
- these keys.
-
- Initially your newly registered application is restricted to the "Sandbox" environment only. To move it to production,
- you may promote it by clicking the "Promote to production" button. Notice that you will get a different API key and secret,
- so these values in your application should be adjusted accordingly.
-
- Depending on the kind of authentication used, an application may be based on either the Autonomous Client or the Web-Server
- Client OAuth flow (see https://devconnect-api.att.com/docs/oauth-v1/client-credentials-grant-type or
- https://devconnect-api.att.com/docs/oauth-v1/authorization-code-grant-type respectively).
-
-
-2. Installation
-
-** Requirements
-
- 1. To run the this sample application you need an IIS Server.
- 2. Change the value of "href" at the following line in Default.aspx to point to the location of the "common.css" of "style" folder:
- <link rel="stylesheet" type="text/css" href="../../style/common.css"/>
- 3. Change the value of the "url" at the following line in common.css to point to the location of the "att.gif" of "images" folder.
- div#header { background:url(../images/att.gif) left center no-repeat; margin: 10px 5px}
-
-
-3. Parameters
-
-
-Each sample application contains a config.web file. It holds configurable parameters described in an easy to read format.
-Please populate the following parameters in config.web as specified below:
-
-1) api_key : {set the value as per your registered application 'API key' field value}
-
-
-2) secret_key : {set the value as per your registered application 'Secret key' field value}
-
-
-3) authorize_redirect_uri : {set the value as per your registered application 'OAuth Redirect URL' field value}
-
-4) FQDN : https://api.att.com
-
-5) scope : DC
-
-Note: If your application is promoted from Sandbox environment to Production environment and you decide to use production application settings,
-you must update parameters 1-2 as per production application details.
-
-
-
-4. Running the application
-
-Suppose you copied the sample app files in your IIS server webroot/dc/app1/ folder, In order to run the sample application,
-type in'http://IIS_HOSTNAME/dc/app1/Default.aspx'
View
39 DC/Csharp/app1/Web.config
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<!--
- For more information on how to configure your ASP.NET application, please visit
- http://go.microsoft.com/fwlink/?LinkId=169433
- -->
-<configuration>
- <system.web>
- <compilation debug="true" targetFramework="4.0"/>
- <customErrors mode="Off"></customErrors>
- </system.web>
- <appSettings>
-
- <!-- This is mandatory key and value should be equal
- to DC Service registered application 'API key'
- example: value="2726942c798aaaaa4bd3625d95cc7355"-->
- <add key="api_key" value=""/>
-
- <!-- This is mandatory key and value should be equal
- to DC Service registered application 'Secret key'
- example: value="5fb012657aaa6c7d"-->
- <add key="secret_key" value=""/>
-
- <!-- This is mandatory key and value should be equal
- to DC Service registered application 'OAuth Redirect URL'
- example: value="https://IIS-Server/webroot/dc/app1/Default.aspx"-->
- <add key="authorize_redirect_uri" value=""/>
-
- <!-- This is mandatory key and value should be equal
- to https://api.att.com for production environment
- example: value="https://api.att.com"-->
- <add key="FQDN" value=""></add>
-
- <!-- This is optional key and value should be equal
- to "DC"
- example: value="DC"-->
- <add key="scope" value=""/>
-
- </appSettings>
-</configuration>
View
BIN  DC/Csharp/app1/images/att.gif
Deleted file not rendered
View
39 DC/Csharp/app1/style/common.css
@@ -1,39 +0,0 @@
-/*@charset "utf-8";*/
-/* CSS Document */
-
-html,body{ margin:0;padding:0}
-body{font: 12px arial,sans-serif;text-align:center; color: #000}
-p{margin:0 10px 10px}
-a{color: #69BBE5}
-h1 { font-size: 16px; margin: 0 0}
-h2 { font-size: 14px; margin: 0 0}
-div#header { background:url(../images/att.gif) left center no-repeat; margin: 10px 5px}
-div#hcLeft { float:left; text-align: right; width: 39%; font-weight: bold}
-div#hcRight { float:right; width: 59%}
-
-div#content { border-top: 1px dashed #999}
-div#container{ text-align:left}
-div#content p{line-height:1.4}
-div#footer{ font-size: 9px; text-align: center; border-top: 1px dashed #999; margin-top: 10px; padding-top: 10px}
-div#footer p{ width: 500px; margin:0 auto;padding:5px 10px}
-
-div#container{width:1000px;margin:0 auto}
-div#navigation{float:left;width:500px}
-div#extra{float:right;width:500px}
-div#extra1{float:right;width:500px; height: 97px}
-div#extra2{float:left;width:100%}
-div#extraleft{float:left;width:200px}
-div#footer{clear:both;width:100%}
-
-div#gallerywrapper { width: 900px; margin: 10px auto; padding: 10px}
-div#gallery { float: left; width: 150px; height: 190px; padding: 10px; margin-bottom: 15px; font-size: 9px}
-
-.label, .cell { font: 12px Arial, Sans-serif}
-.label { font-weight: bold}
-
-.error { margin: 0 auto; border: 3px outset red; background: #fcc; width: 250px; padding: 5px; font-size: 11px }
-.warning { margin: 0 auto; border: 3px outset yellow; background: #ffc; width: 250px; padding: 5px; font-size: 11px }
-.success { margin: 0 auto; border: 3px outset green; background: #cfc; width: 250px; padding: 5px; font-size: 11px }
-.errorWide { margin: 0 auto; border: 3px outset red; background: #fcc; width: 650px; padding: 5px; font-size: 11px }
-.warningWide { margin: 0 auto; border: 3px outset yellow; background: #ffc; width: 650px; padding: 5px; font-size: 11px }
-.successWide { margin: 0 auto; border: 3px outset green; background: #cfc; width: 650px; padding: 5px; font-size: 11px }
View
BIN  DC/Java/.DS_Store
Binary file not shown
View
BIN  DC/Java/app1/.DS_Store
Binary file not shown
View
213 DC/Java/app1/DC.jsp
@@ -1,213 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en"><head>
- <title>AT&T Sample DC Application - Get Device Capabilities Application</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
- <link rel="stylesheet" type="text/css" href="style/common.css"/ >
- <script type="text/javascript" src="js/helper.js">
-</script>
-<body>
-
-<%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
-<%@ page import="org.apache.commons.httpclient.*"%>
-<%@ page import="org.apache.commons.httpclient.methods.*"%>
-<%@ page import="org.json.JSONObject"%>
-<%@ page import="java.util.Iterator"%>
-<%@ include file="config.jsp" %>
-<%
-String scope = (String) session.getAttribute("scope");
-if(scope==null) scope="";
-String postOauth = "DC.jsp?getDeviceInfo=true";
-String redirectUri = "";
-String address = request.getParameter("address");
-if(address==null || address.equalsIgnoreCase("null"))
- address = (String) session.getAttribute("addressDC");
-if(address==null || address.equalsIgnoreCase("null"))
- address = "425-802-8620";
-Boolean newAddress = false;
-if(!address.equalsIgnoreCase((String)session.getAttribute("addressDC"))) {
- newAddress = true;
-}
-session.setAttribute("addressDC",address);
-String getDeviceInfo = request.getParameter("getDeviceInfo");
-%>
-
-<div id="container">
-<!-- open HEADER --><div id="header">
-
-<div>
- <div id="hcRight">
- <%=new java.util.Date()%>
- </div>
- <div id="hcLeft">Server Time:</div>
-</div>
-<div>
- <div id="hcRight"><script language="JavaScript" type="text/javascript">
-var myDate = new Date();
-document.write(myDate);
-</script></div>
- <div id="hcLeft">Client Time:</div>
-</div>
-<div>
- <div id="hcRight"><script language="JavaScript" type="text/javascript">
-document.write("" + navigator.userAgent);
-</script></div>
- <div id="hcLeft">User Agent:</div>
-</div>
-<br clear="all" />
-</div><!-- close HEADER -->
-
-<div id="wrapper">
-<div id="content">
-
-<h1>AT&T Sample DC Application - Get Device Capabilities Application</h1>
-<h2>Feature 1: Get Device Capabilities</h2>
-
-</div>
-</div>
-<form method="post" name="getDeviceInfo" action="DC.jsp">
-<div id="navigation">
-
-<table border="0" width="100%">
- <tbody>
- <tr>
- <td width="20%" valign="top" class="label">Phone:</td>
- <td class="cell"><input maxlength="16" size="12" name="address" value="<%=address%>" style="width: 90%">
- </td>
- </tr>
- </tbody></table>
-
-</div>
-<div id="extra">
-
-<table border="0" width="100%">
- <tbody>
- <tr>
- <td class="cell"><button type="submit" name="getDeviceInfo">Get Device Capabilities</button>
- </td>
- </tr>
- </tbody></table>
-
-</div>
-<br clear="all" />
-</form>
-
-<%
- if(getDeviceInfo!=null) {
- //Check for a few known formats the user could have entered the address, adjust accordingly
- String invalidAddress = null;
- if((address.indexOf("-")==3) && (address.length()==12))
- address = "tel:" + address.substring(0,3) + address.substring(4,7) + address.substring(8,12);
- else if((address.indexOf(":")==3) && (address.length()==14))
- address = address;
- else if((address.indexOf("-")==-1) && (address.length()==10))
- address = "tel:" + address;
- else if((address.indexOf("-")==-1) && (address.length()==11))
- address = "tel:" + address.substring(1);
- else if((address.indexOf("-")==-1) && (address.indexOf("+")==0) && (address.length()==12))
- address = "tel:" + address.substring(2);
- else
- invalidAddress = "yes";
-if(invalidAddress==null) {
- String accessToken = request.getParameter("access_token");
- if(accessToken==null || accessToken=="null"){
- accessToken = (String) session.getAttribute("accessToken");}
- if((newAddress==true) || (accessToken==null) || (!scope.equalsIgnoreCase("DC")) && (!scope.equalsIgnoreCase("SMS,MMS,WAP,DC,TL,PAYMENT"))) {
- session.setAttribute("scope", "DC");
- session.setAttribute("clientId", clientIdWeb);
- session.setAttribute("clientSecret", clientSecretWeb);
- session.setAttribute("address", address);
- session.setAttribute("postOauth", postOauth);
- session.setAttribute("redirectUri", redirectUri);
- response.sendRedirect("oauth.jsp?getExtCode=yes");
- }
- String url = FQDN + "/1/devices/" + address + "/info";
- HttpClient client = new HttpClient();
- GetMethod method = new GetMethod(url);
- method.setQueryString("access_token=" + accessToken);
- method.addRequestHeader("Accept","application/json");
- int statusCode = client.executeMethod(method);
- if(statusCode==200) {
- JSONObject jsonResponse = new JSONObject(method.getResponseBodyAsString());
- JSONObject deviceId = new JSONObject(jsonResponse.getString("deviceId"));
- JSONObject capabilities = new JSONObject(jsonResponse.getString("capabilities"));
- Iterator deviceIdKeys = deviceId.keys();
- Iterator capabilitiesKeys = capabilities.keys();
- %>
- <div class="successWide">
- <strong>SUCCESS:</strong><br />
- Device parameters listed below.
- </div>
- <br />
-
- <div align="center">
- <table width="500" cellpadding="1" cellspacing="1" border="0">
- <thead>
- <tr>
- <th width="50%" class="label">Parameter</th>
- <th width="50%" class="label">Value</th>
- </tr>
- </thead>
- <tbody>
- <%
- while(deviceIdKeys.hasNext()) {
- String key = (String) deviceIdKeys.next();
- %>
- <tr>
- <td class="cell" align="center"><em><%=key%></em></td>
- <td class="cell" align="center"><em><%=deviceId.getString(key)%></em></td>
- </tr>
- <%
- }
- %>
- <%
- while(capabilitiesKeys.hasNext()) {
- String key = (String) capabilitiesKeys.next();
- %>
- <tr>
- <td class="cell" align="center"><em><%=key%></em></td>
- <td class="cell" align="center"><em><%=capabilities.getString(key)%></em></td>
- </tr>
- <%
- }
- %>
- </tbody>
- </table>
- </div>
-
- <br />
-<%
- }
- else {
- %>
- <div class="errorWide">
- <strong>ERROR:</strong><br />
- <%=method.getResponseBodyAsString()%>
- </div>
- <br />
- <%
- }
- method.releaseConnection();
- } else { %>
- <div class="errorWide">
- <strong>ERROR:</strong><br />
- Invalid Address Entered
- </div><br/>
-<% }
- }
-%>
-
-<div id="footer">
-
- <div style="float: right; width: 20%; font-size: 9px; text-align: right">Powered by AT&amp;T Virtual Mobile</div>
- <p>&#169; 2011 AT&amp;T Intellectual Property. All rights reserved. <a href="http://developer.att.com/" target="_blank">http://developer.att.com</a>
-<br>
-The Application hosted on this site are working examples intended to be used for reference in creating products to consume AT&amp;T Services and not meant to be used as part of your product. The data in these pages is for test purposes only and intended only for use as a reference in how the services perform.
-<br>
-For download of tools and documentation, please go to <a href="https://devconnect-api.att.com/" target="_blank">https://devconnect-api.att.com</a>
-<br>
-For more information contact <a href="mailto:developer.support@att.com">developer.support@att.com</a>
-
-</div>
-</div>
-
-</body></html>
View
3  DC/Java/app1/META-INF/MANIFEST.MF
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Class-Path:
-
View
81 DC/Java/app1/README.txt
@@ -1,81 +0,0 @@
-
- AT&T API Samples - DC app 1
- ------------------------------
-
-This file describes how to set up, configure and run the Java Applications of the AT&T HTML5 Program sample applications.
-It covers all steps required to register the application on DevConnect and, based on the generated API keys and secrets,
-create and run one's own full-fledged sample applications.
-
- 1. Configuration
- 2. Installation
- 3. Parameters
- 4. Running the application
-
-
-1. Configuration
-
- Configuration consists of a few steps necessary to get an application registered on DevConnect with the proper services and
- endpoints, depending on the type of client-side application (autonomous/non-autonomous).
-
- To register an application, go to https://devconnect-api.att.com/ and login with your valid username and password.
- Next, choose "My Apps" from the bar at the top of the page and click the "Setup a New Application" button.
-
- Fill in the form, in particular all fields marked as "required".
-
- Be careful while filling in the "OAuth Redirect URL" field. It should contain the URL that the oAuth provider will redirect
- users to when he/she successfully authenticates and authorizes your application. For this application, it should point to
- the oauth.jsp file inside this application folder. For example, if running on a local machine in a default Tomcat installation,
- your OAuth Redirect URL might be http://localhost:8080/SampleApp/oauth.jsp
-
-NOTE: You MUST select Device Capabilities in the list of services under field 'Services' in order to use this sample application code.
-
- Having your application registered, you will get back an important pair of data: an API key and Secret key. They are
- necessary to get your applications working with the AT&T HTML5 APIs. See 'Adjusting parameters' below to learn how to use
- these keys.
-
- Initially your newly registered application is restricted to the "Sandbox" environment only. To move it to production,
- you may promote it by clicking the "Promote to production" button. Notice that you will get a different API key and secret,
- so these values in your application should be adjusted accordingly.
-
- Depending on the kind of authentication used, an application may be based on either the Autonomous Client or the Web-Server
- Client OAuth flow (see https://devconnect-api.att.com/docs/oauth20/autonomous-client-application-oauth-flow or
- https://devconnect-api.att.com/docs/oauth20/web-server-client-application-oauth-flow respectively).
-
-
-2. Installation
-
-** Requirements
-
- To run the examples you need a Java environment and at least Apache Tomcat 6, or another Java web server such as Jetty.
-
-** Setting up multiple sample applications simultaneously
-
- In case multiple applications need to be run at the same time, make sure to put each app in a separate folder and
- adjust your OAuth Redirect URL accordingly.
-
-3. Parameters
-
-Each sample application contains a config.jsp file. It holds configurable parameters described in an easy to read format.
-Please populate the following parameters in config.jsp as specified below:
-
-1) clientIdWeb : {set the value as per your registered appliaction 'API key' field value}
-
-2) clientSecretWeb : {set the value as per your registered appliaction 'Secret key' field value}
-
-3) FQDN : https://api.att.com
-
-Note: If your application is promoted from Sandbox environment to Production environment and you decide to use production
-application settings, you must update parameters 1-2 as per production application details.
-
-
-4. Running the application
-
- To run the application, put the entire contents of the application folder into a separate folder named SampleApp inside the webapps
- folder in your Apache Tomcat home directory. If you have specified a different home directory in Tomcat for your web applications,
- put it there instead.
-
- Depending on your security settings in Apache Tomcat, you might need to enable write access to the OauthStorage.jsp file.
-
- Once you start tomcat, typically using the command "<your-tomcat-root-folder>/bin/startup.sh", your application becomes available
- in a web browser, so you may visit: http://localhost:8080/SampleApp/DC.jsp to see it working.
-
View
BIN  DC/Java/app1/WEB-INF/.DS_Store
Binary file not shown
View
BIN  DC/Java/app1/WEB-INF/lib/.DS_Store
Binary file not shown
View
BIN  DC/Java/app1/WEB-INF/lib/commons-codec-1.5.jar
Binary file not shown
View
BIN  DC/Java/app1/WEB-INF/lib/commons-httpclient-3.0.1.jar
Binary file not shown
View
BIN  DC/Java/app1/WEB-INF/lib/commons-io-1.4.jar
Binary file not shown
View
BIN  DC/Java/app1/WEB-INF/lib/commons-logging-1.1.1.jar
Binary file not shown
View
BIN  DC/Java/app1/WEB-INF/lib/json-rpc-1.0.jar
Binary file not shown
View
5 DC/Java/app1/config.jsp
@@ -1,5 +0,0 @@
-<%
-String clientIdWeb = "";
-String clientSecretWeb = "";
-String FQDN = "https://api.att.com";
-%>
View
BIN  DC/Java/app1/images/att.gif
Deleted file not rendered
View
172 DC/Java/app1/oauth.jsp
@@ -1,172 +0,0 @@
-<!--
-Licensed by AT&T under 'Software Development Kit Tools Agreement.' September 2011
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
-Copyright 2011 AT&T Intellectual Property. All rights reserved. http://developer.att.com
-For more information contact developer.support@att.com
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<HTML lang=en xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>Application 1</TITLE>
-<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
-<SCRIPT type=text/javascript src="helper.js">
-</SCRIPT>
-<META name=GENERATOR content="MSHTML 8.00.6001.19046"></HEAD>
-<BODY>
-<TABLE border=0 width="100%">
- <TBODY>
- <TR>
- <TD rowSpan=2 width="25%" align=left><IMG
- src="http://developer.att.com/developer/images/att.gif"></TD>
- <TD width="15%" align=right>Server Time:</TD>
- <TD width="60%" align=left>
- <SCRIPT language=JavaScript type=text/javascript>
-var myDate = new Date();
-document.write(myDate.format('l, F d, Y H:i') + ' PDT');
-</SCRIPT>
-</TD></TR>
- <TR>
- <TD width="15%" align=right>Client Time:</TD>
- <TD width="25%" align=left>
- <SCRIPT language=JavaScript type=text/javascript>
-var myDate = new Date();
-document.write(myDate.format('l, F d, Y H:i') + ' PDT');
-</SCRIPT>
-</TD></TR></TBODY></TABLE>
-
-<HR size=px"></HR>
-<font size=4px"><B>ATT sample Oauth application</B></font><BR><BR>
-<%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
-<%@ page import="org.apache.commons.httpclient.*"%>
-<%@ page import="org.apache.commons.httpclient.methods.*"%>
-<%@ page import="org.json.JSONObject"%>
-<%@ include file="config.jsp" %>
-<%
- String clientId = request.getParameter("clientId");
-if(clientId!=null)
-if(clientId.equalsIgnoreCase("default"))
- clientId = clientIdWeb;
-if((clientId==null) || (clientId.equalsIgnoreCase("null")))
- clientId = (String) session.getAttribute("clientId");
-if(clientId==null)
- clientId = "";
-String clientSecret = request.getParameter("clientSecret");
-if(clientSecret!=null)
-if(clientSecret.equalsIgnoreCase("default"))
- clientSecret = clientSecretWeb;
-if((clientSecret==null) || (clientSecret.equalsIgnoreCase("null")))
- clientSecret = (String) session.getAttribute("clientSecret");
-if(clientSecret==null)
- clientSecret = "";
-String redirectUri = request.getParameter("redirectUri");
-if(redirectUri==null)
- redirectUri = (String) session.getAttribute("redirectUri");
-if(redirectUri==null)
- redirectUri = "https://code-api-att.com/apigee-public/oauth.jsp";
-String scope = request.getParameter("scope");
-if(scope==null)
- scope = (String) session.getAttribute("scope");
-if(scope==null)
- scope = "SMS,MMS";
-session.setAttribute("scope", scope);
-String code = request.getParameter("code");
-if(code==null) code="";
-String print = "";
-String getExtCode = request.getParameter("getExtCode");
-String refreshToken = request.getParameter("refreshToken");
-if (refreshToken==null)
- refreshToken=(String) session.getAttribute("refreshToken");
-if (refreshToken==null)
- refreshToken="";
-String getRefreshToken = request.getParameter("getRefreshToken");
-if (getRefreshToken==null) getRefreshToken="";
-%>
-
-<form name="getExtCode" method="post">
-API Key <input type="text" name="clientId" value="default" size=40 /><br>
-API Secret <input type="text" name="clientSecret" value="default" size=40 /><br>
-{FQDN} <input type="text" name="FQDN" value="<%=FQDN%>" size=60 /><br>
-Scope <input type="text" name="scope" value="<%=scope%>" size=40 /><br />
-Redirect URI <input type="text" name="redirectUri" value="<%=redirectUri%>" size=60 /><br />
-<input type="submit" name="getExtCode" value="Get Access Token" />
-</form><br><br>
-
- <%
- if(getExtCode!=null) {
- session.setAttribute("clientId", clientId);
- session.setAttribute("clientSecret", clientSecret);
- session.setAttribute("FQDN", FQDN);
- response.sendRedirect(FQDN + "/oauth/authorize?client_id=" + clientId + "&scope=" + scope + "&redirect_uri=" + redirectUri);
- }
-
- if(!code.equalsIgnoreCase("")) {
- String url = FQDN + "/oauth/token";
- HttpClient client = new HttpClient();
- PostMethod method = new PostMethod(url);
- String b = "client_id=" + clientId + "&client_secret=" + clientSecret + "&grant_type=authorization_code&code=" + code;
- method.addRequestHeader("Content-Type","application/x-www-form-urlencoded");
- method.setRequestBody(b);
- int statusCode = client.executeMethod(method);
- print = method.getResponseBodyAsString();
- if(statusCode==200){
- JSONObject rpcObject = new JSONObject(method.getResponseBodyAsString());
- String accessToken = rpcObject.getString("access_token");
- refreshToken = rpcObject.getString("refresh_token");
- session.setAttribute("refreshToken", refreshToken);
- session.setAttribute("accessToken", accessToken);
-
- String postOauth = (String) session.getAttribute("postOauth");
- if(postOauth!= null) {
- session.setAttribute("postOauth", null);
- response.sendRedirect(postOauth);
- }
- }
- method.releaseConnection();
- }
- %>
-
-<form name="getRefreshToken" method="post">
-API Key <input type="text" name="clientId" value="<%=clientId%>" size=40 /><br />
-API Secret <input type="text" name="clientSecret" value="<%=clientSecret%>" size=40 /><br />
-Refresh Token <input type="text" name="refreshToken" value="<%=refreshToken%>" size=60 /><br />
-<input type="submit" name="getRefreshToken" value="Refresh Access Token" />
-</form><br><br>
-
- <%
- if(!getRefreshToken.equalsIgnoreCase("")) {
- session.setAttribute("clientId",clientId);
- session.setAttribute("clientSecret",clientSecret);
- String url = FQDN + "/oauth/token";
- HttpClient client = new HttpClient();
- PostMethod method = new PostMethod(url);
- String b = "client_id=" + clientIdAut + "&client_secret=" + clientSecretAut + "&grant_type=refresh_token&refresh_token=" + refreshToken;
- method.addRequestHeader("Content-Type","application/x-www-form-urlencoded");
- method.setRequestBody(b);
- int statusCode = client.executeMethod(method);
- print = method.getResponseBodyAsString();
- if(statusCode==200){
- String accessToken = print.substring(18,50);
- session.setAttribute("accessToken", accessToken);
- String postOauth = (String) session.getAttribute("postOauth");
- if(postOauth!= null) {
- session.setAttribute("postOauth", null);
- response.sendRedirect(postOauth);
- } else {
-
- }
- }
- method.releaseConnection();
- }
- %>
-<br><br><html><body><%=print%></body></html>
-
-<div style="position:absolute;bottom:0px;left:30%;width:40%;font-size:9px;" align="center" >
-� 2011 AT&T Intellectual Property. All rights reserved. <a href="http://developer.att.com" target="_blank">http://developer.att.com</a>
-<br/>
-The Application hosted on this site are working examples intended to be used for reference in creating products to consume AT&T Services and not meant to be used as part of your product. The data in these pages is for test purposes only and intended only for use as a reference in how the services perform.
-<br/>
-For download of tools and documentation, please go to <a href="https://devconnect-api.att.com" target="_blank">https://devconnect-api.att.com</a>
-<br/>
-For more information contact <a href="mailto:developer.support@att.com">developer.support@att.com</a>
-<br/><br/>
-</div>
-
View
39 DC/Java/app1/style/common.css
@@ -1,39 +0,0 @@
-@charset "utf-8";
-/* CSS Document */
-
-html,body{ margin:0;padding:0 }
-body{font: 12px arial,sans-serif;text-align:center; color: #000}
-p{margin:0 10px 10px}
-a{color: #69BBE5 }
-h1 { font-size: 16px; margin: 0 0; }
-h2 { font-size: 14px; margin: 0 0; }
-div#header { background:url(../images/att.gif) left center no-repeat; margin: 10px 5px; }
-#hcLeft { float:left; text-align: right; width: 39%; font-weight: bold }
-#hcRight { float:right; width: 59% }
-
-div#content { border-top: 1px dashed #999; }
-
-div#container{ text-align:left; }
-div#content p{line-height:1.4}
-div#navigation{ }
-div#extra{ }
-div#footer{ font-size: 9px; text-align: center; border-top: 1px dashed #999; margin-top: 10px; padding-top: 10px }
-div#footer p{ width: 500px; margin:0 auto;padding:5px 10px}
-
-div#container{width:1000px;margin:0 auto}
-div#navigation{float:left;width:500px}
-div#extra{float:right;width:500px}
-div#footer{clear:both;width:100%}
-
-div#gallerywrapper { width: 900px; margin: 10px auto; padding: 10px }
-div#gallery { float: left; width: 150px; height: 240px; padding: 10px; margin-bottom: 15px; font-size: 9px }
-
-.label, .cell { font: 12px Arial, Sans-serif; }
-.label { font-weight: bold }
-
-.error { margin: 0 auto; border: 3px outset red; background: #fcc; width: 250px; padding: 5px; font-size: 11px }
-.warning { margin: 0 auto; border: 3px outset yellow; background: #ffc; width: 250px; padding: 5px; font-size: 11px }
-.success { margin: 0 auto; border: 3px outset green; background: #cfc; width: 250px; padding: 5px; font-size: 11px }
-.errorWide { margin: 0 auto; border: 3px outset red; background: #fcc; width: 650px; padding: 5px; font-size: 11px }
-.warningWide { margin: 0 auto; border: 3px outset yellow; background: #ffc; width: 650px; padding: 5px; font-size: 11px }
-.successWide { margin: 0 auto; border: 3px outset green; background: #cfc; width: 650px; padding: 5px; font-size: 11px }
View
BIN  DC/PHP/.DS_Store
Binary file not shown
View
BIN  DC/PHP/app1/.DS_Store
Binary file not shown
View
69 DC/PHP/app1/README.txt
@@ -1,69 +0,0 @@
-
- AT&T API Samples - Device Capabilities
- ----------------------------------------
-
-This file describes how to set up, configure and run the php versions of the AT&T HTML5 Program sample applications.
-It covers all steps required to register the application on DevConnect and, based on the generated API keys and secrets,
-create and run one's own full-fledged sample applications.
-
- 1. Configuration
- 2. Installation
- 3. Parameters
-
-
-1. Configuration
-
- Configuration consists of a few steps necessary to get an application registered on DevConnect with the proper services and
- endpoints, depending on the type of client-side application (autonomous/non-autonomous).
-
- To register an application, go to https://devconnect-api.att.com/ and login with your valid username and password.
- Next, choose "My Apps" from the bar at the top of the page and click the "Setup a New Application" button.
-
- Fill in the form, in particular all fields marked as "required".
-
- Be careful while filling in the "OAuth Redirect URL" field. It should contain the URL that the oAuth provider will redirect
- users to when he/she successfully authenticates and authorizes your application.
-
- NOTE: You MUST select Device capability in the list of services under field 'Services' in order to use this sample
- application code.
-
- Having your application registered, you will get back an important pair of data: an API key and Secret key. They are
- necessary to get your applications working with the AT&T HTML5 APIs. See 'Adjusting parameters' below to learn how to use
- these keys.
-
- Initially your newly registered application is restricted to the "Sandbox" environment only. To move it to production,
- you may promote it by clicking the "Promote to production" button. Notice that you will get a different API key and secret,
- so these values in your application should be adjusted accordingly.
-
- Depending on the kind of authentication used, an application may be based on either the Autonomous Client or the Web-Server
- Client OAuth flow (see https://devconnect-api.att.com/docs/oauth20/autonomous-client-application-oauth-flow or
- https://devconnect-api.att.com/docs/oauth20/web-server-client-application-oauth-flow respectively).
-
-
-2. Installation
-
-Requirements:
-Apache web server
-PHP 5.2+
-Apache and php configured , on most Linux systems if installed using packages this will be done automatically
-
-Installation:
-Copy the sample application folder to apache web root folder, for example /var/www/html
-
-
-3. Parameters
-
- Each application contains a config.php file. It holds the following configurable parameters and defaults
-
- 1) $api_key : Client API key
- 2) $secret_key : Client secret key
- 3) $short_code : Short code
- 4) $FQDN = "https://api.att.com" : Endpoint
- 5) $authorize_redirect_uri = "" : url where oAuth provider will redirect to in case of successful authentication.
- Needs to be exactly the same as one used while registering application in DevConnect.
- 6) $scope = "DC" : Oauth scope ( SMS )
- 7) $default_address : Default phone number
-
- Note: If your application is promoted from Sandbox environment to Production environment and you decide to use
- production application settings, you must update parameters 1-2 as per production application details.
-
View
39 DC/PHP/app1/common.css
@@ -1,39 +0,0 @@
-@charset "utf-8";
-/* CSS Document */
-
-html,body{ margin:0;padding:0 }
-body{font: 12px arial,sans-serif;text-align:center; color: #000}
-p{margin:0 10px 10px}
-a{color: #69BBE5 }
-h1 { font-size: 16px; margin: 0 0; }
-h2 { font-size: 14px; margin: 0 0; }
-div#header { background:url(images/att.gif) left center no-repeat; margin: 10px 5px; }
-#hcLeft { float:left; text-align: right; width: 39%; font-weight: bold }
-#hcRight { float:right; width: 59% }
-
-div#content { border-top: 1px dashed #999; }
-
-div#container{ text-align:left; }
-div#content p{line-height:1.4}
-div#navigation{ }
-div#extra{ }
-div#footer{ font-size: 9px; text-align: center; border-top: 1px dashed #999; margin-top: 10px; padding-top: 10px }
-div#footer p{ width: 500px; margin:0 auto;padding:5px 10px}
-
-div#container{width:1000px;margin:0 auto}
-div#navigation{float:left;width:500px}
-div#extra{float:right;width:500px}
-div#footer{clear:both;width:100%}
-
-div#gallerywrapper { width: 900px; margin: 10px auto; padding: 10px }
-div#gallery { float: left; width: 150px; height: 190px; padding: 10px; margin-bottom: 15px; font-size: 9px }
-
-.label, .cell { font: 12px Arial, Sans-serif }
-.label { font-weight: bold }
-
-.error { margin: 0 auto; border: 3px outset red; background: #fcc; width: 250px; padding: 5px; font-size: 11px }
-.warning { margin: 0 auto; border: 3px outset yellow; background: #ffc; width: 250px; padding: 5px; font-size: 11px }
-.success { margin: 0 auto; border: 3px outset green; background: #cfc; width: 250px; padding: 5px; font-size: 11px }
-.errorWide { margin: 0 auto; border: 3px outset red; background: #fcc; width: 650px; padding: 5px; font-size: 11px }
-.warningWide { margin: 0 auto; border: 3px outset yellow; background: #ffc; width: 650px; padding: 5px; font-size: 11px }
-.successWide { margin: 0 auto; border: 3px outset green; background: #cfc; width: 650px; padding: 5px; font-size: 11px }
View
16 DC/PHP/app1/config.php
@@ -1,16 +0,0 @@
-<!--
-Licensed by AT&T under 'Software Development Kit Tools Agreement.' September 2011
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
-Copyright 2011 AT&T Intellectual Property. All rights reserved. http://developer.att.com
-For more information contact developer.support@att.com
--->
-
-<?php
- $api_key = "";
- $secret_key = "";
- $short_code = "";
- $FQDN = "https://api.att.com";
- $authorize_redirect_uri = "http://localhost/attf/app/index.php";
- $scope = "DC";
- $default_address = "425-802-8620";
-?>
View
BIN  DC/PHP/app1/images/att.gif
Deleted file not rendered
View
275 DC/PHP/app1/index.php
@@ -1,275 +0,0 @@
-<?php
- header("Content-Type: text/html; charset=ISO-8859-1");
- session_start();
- include ("config.php");
-
-function GetAccessToken($FQDN,$api_key,$secret_key,$scope,$authCode){
-
- // **********************************************************************
- // ** code to get access token by passing auth code, client ID and
- // ** client secret
- // **********************************************************************
-
- //Form URL to get the access token
- $accessTok_Url = "$FQDN/oauth/token";
- //http header values
- $accessTok_headers = array(
- 'Content-Type: application/x-www-form-urlencoded'
- );
-
-
- //Invoke the URL
- $post_data="client_id=".$api_key."&client_secret=".$secret_key."&code=".$authCode."&grant_type=authorization_code";
-
- $accessTok = curl_init();
- curl_setopt($accessTok, CURLOPT_URL, $accessTok_Url);
- curl_setopt($accessTok, CURLOPT_HTTPGET, 1);
- curl_setopt($accessTok, CURLOPT_HEADER, 0);
- curl_setopt($accessTok, CURLINFO_HEADER_OUT, 0);
- curl_setopt($accessTok, CURLOPT_HTTPHEADER, $accessTok_headers);
- curl_setopt($accessTok, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($accessTok, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($accessTok, CURLOPT_POST, 1);
- curl_setopt($accessTok, CURLOPT_POSTFIELDS,$post_data);
- $accessTok_response = curl_exec($accessTok);
-
- $responseCode=curl_getinfo($accessTok,CURLINFO_HTTP_CODE);
- /*
- If URL invocation is successful fetch the access token and store it in session,
- else display the error.
- */
- if($responseCode==200)
- {
- $jsonObj = json_decode($accessTok_response);
- $accessToken = $jsonObj->{'access_token'};//fetch the access token from the response.
- $_SESSION["dc1_deviceInfo_access_token"]=$accessToken;//store the access token in to session.
- }
- else{
- // echo curl_error($accessTok);
- }
- curl_close ($accessTok);
- header("location:index.php");//redirect to the index page.
- exit;
-
-}
-
-function getAuthCode($FQDN,$api_key,$secret_key,$scope,$authorize_redirect_uri){
- //Form URL to get the authorization code
- $authorizeUrl = "$FQDN/oauth/authorize";
- $authorizeUrl .= "?scope=".$scope;
- $authorizeUrl .= "&client_id=".$api_key;
- $authorizeUrl .= "&redirect_uri=".$authorize_redirect_uri;
-
- header("Location: $authorizeUrl");
-}
-
-$address=$_SESSION["dc1_address"];
-if($address==null){
- $address = $default_address;
- $_SESSION["dc1_address"] = $address;
- }
-
-
-/* Extract the session variables */
-$accessToken = $_SESSION["dc1_deviceInfo_access_token"];
-
-if (!empty($_REQUEST["deviceInfo"])) {
- $_SESSION["dc1_deviceInfo"] = true;
- $address = $_POST['address'];
- if( $address != $_SESSION["dc1_address"]){ // new address entered, need to request new auth code and token
- $accessToken = null;
- $authCode =null;
- }
- $_SESSION["dc1_address"] = $_POST['address'];
- }
-
-if ($_SESSION["dc1_deviceInfo"]) {
-
- if($accessToken == null || $accessToken == '') {
- $authCode = $_GET["code"];
- if ($authCode == null || $authCode == "") {
- getAuthCode( $FQDN,$api_key,$secret_key,$scope,$authorize_redirect_uri);
- }else{
- $accessToken = GetAccessToken($FQDN,$api_key,$secret_key,$scope,$authCode);
- $_SESSION["dc1_deviceInfo_access_token"] = $accessToken;
- }
- }
- }
-
-?>
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en"><head>
- <title>AT&T Sample DC Application � Get Device Capabilities Application</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
- <link rel="stylesheet" type="text/css" href="common.css"/ >
-
-<body>
-<div id="container">
-<!-- open HEADER --><div id="header">
-
-<div>
- <div id="hcRight">
-<?php echo date("D M j G:i:s T Y"); ?>
-</div>
- <div id="hcLeft">Server Time:</div>
-</div>
-<div>
- <div id="hcRight"><script language="JavaScript" type="text/javascript">
-var myDate = new Date();
-document.write(myDate);
-</script></div>
- <div id="hcLeft">Client Time:</div>
-</div>
-<div>
- <div id="hcRight"><script language="JavaScript" type="text/javascript">
-document.write("" + navigator.userAgent);
-</script></div>
- <div id="hcLeft">User Agent:</div>
-</div>
-<br clear="all" />
-</div><!-- close HEADER -->
-
-<div id="wrapper">
-<div id="conte