SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
                                     	
                                                                                       	
  


                                                        	
   	
  


	
  

              	
  
                        	
                                                                                                                      	
   	
  
                                                                                                                                                                        	
  


                                                                    	
  

        	
   	
  



                                                                                                                       	
   	
  

                                                                                                                                                            	
   	
  

                                                                           	
   	
  

                                                 	
  

                                               ⽰示                                       	
   	
  
                                                                                                                                                                        	
  


                                                                                                                	
  
                	
                                                                                                                 ⽤用

                                                                                                                                               ⽤用

                                   	
   	
  

                       	
   	
  

                	
                                                                     ⽤用

              	
  

                                                                                                    	
   	
  




                                                                                                        1
•                                                                                                           ⾏行行

                                                    	
  

•                                                                                                               	
            	
      	
     	
  

                        	
  

                                                                                                         	
  

•                                                                        	
                	
            	
  

            ⽤用

                                                             ⽂文

                                                	
   	
  

•                                                   	
                                                   ⽤用

                   ⼀一                    ⽤用

                        	
   	
  

•                                        	
                 ⽣生                                                         ⽰示            ⽰示

            ⾼高                                                                                                         	
  

                                                                                	
                	
  

                                    ⽰示                            	
  

            	
  

	
   	
  

•           json { "status_code": 200, "status_txt": "OK", "data" : ... }

•           json { "status_code": 403, "status_txt": "RATE_LIMIT_EXCEEDED",
            "data" : null }

•           json { "status_code": 500, "status_txt": "INVALID_URI", "data" : null }

•           json { "status_code": 500, "status_txt": "MISSING_ARG_LOGIN", "data" :

            null }

•           json { "status_code": 503, "status_txt": "UNKNOWN_ERROR", "data" :

            null }

•           jsonp callback_method({ "status_code": 200, "status_txt": "OK",

            "data" : ... })

•           xml

            <?xml version="1.0" encoding="UTF-8"?>

            <response>

                    <status_code>200</status_code>




                                                                                       2
<status_txt>OK</status_txt>

                                    <data>

                                               ...

                                    </data>

                        </response>

	
  
                                                                                                                                                                                                              	
  


        ⽤用                           	
  
                                                                ⽤用                                         ⼀一

                                                                                                                                                                   ⽤用                                         	
   	
  

       ⽤用                                                                                                                                                                ⼗十                              ⽤用

                                                                	
  

                        ⽤用                                                                                                                                    ⽤用                                         ⽣生

                                                                                                                                                  	
  

       ⽤用                                                                                                                              ⽤用                                      	
   	
  


⾼高                                                      ⽤用                    	
  

                                               ⽤用                                                                                 ⾼高                     ⽤用

                                                                                     	
   	
  

                                               	
                                    ⽤用⽅方                              ⽤用                                                                                ⽤用

                                                                                                               	
   	
  
                                                                                                                                                                                                              	
  


                             	
                       	
  

                                                 	
  

⻑⾧長                                                      	
                                             	
                                                                                 	
  

            	
   	
  

        •                            	
                                                                                                                                                           	
  

                                                                       	
                        	
                   	
   	
  

        •                               	
                                                                                             	
                               	
  




                                                                                                                                              3
•                                  	
                                                  	
                                                                                      ⼒力力

                                                                              	
   	
  

        •                                  	
                                                   	
  

                                                                                                                               ⽤用

                                                                                                                                                             	
   	
  

        •                                                	
                                            	
  

                             ⽤用                                                                                                 	
                   ⽤用

                                                                                                              	
                                                                                       	
  

            	
  

        •                                                                                                                                             	
                     	
                               	
     	
  

                                                                                                                                                                                                 	
   	
  

        •               ⽩白                                                                ⽤用                         ⽩白

                             ⽩白                                                                                                                                                          ⾏行行

                   ⽩白                                                                                                     ⽩白                                                         ⾏行行                                                  	
   	
  

        •

                                                                                                                                       	
  

                                                                                                                                              	
                                                                                          	
  

        •



                                           	
   	
  

⼒力力	
   	
  

        •                                                       	
  

                                                                                                                                                                                                                            	
   	
  

        •               	
   	
                                               ⽤用

                             	
   	
  

        •                           	
                                                                                                                                                                                        	
   	
  

        •                                                              	
  

                                                                                                                     ⽰示                              ⽤用                              	
   	
  

        •                                         	
  

                                                                                                                                                                         	
   	
  

	
   	
  




                                                                                                                     4
•                 	
  

    http://api.bit.ly/v3/shorten?login=bitlyapidemo&apiKey=R_0da49e0

    a9118ff35f52f629d2d71bf07&longUrl=http%3A%2F%2Fbetaworks.com%2F&

    format=json

    {

                      "status_code": 200,

                      "data": {

                           "url": "http://bit.ly/cmeH01",

                           "hash": "cmeH01",

                           "global_hash": "1YKMfY",

                           "long_url": "http://betaworks.com/",

                           "new_hash": 0

                      },

                      "status_txt": "OK"

    }

•              	
  

    http://api.bit.ly/v3/shorten?login=bitlyapidemo&apiKey=R_0da49e0

    a9118ff35f52f629d2d71bf07&longUrl=http%3A%2F%2Fbetaworks.com%2F&

    format=xml

    <?xml version="1.0" encoding="UTF-8"?>

    <response>

                      <status_code>200</status_code>

                      <status_txt>OK</status_txt>

                      <data>

                           <url>http://bit.ly/cmeH01</url>

                           <hash>cmeH01</hash>

                           <global_hash>1YKMfY</global_hash>

                           <long_url>http://betaworks.com/</long_url>

                           <new_hash>0</new_hash>

                      </data>

    </response>

•       	
  

    http://api.bit.ly/v3/shorten?login=bitlyapidemo&apiKey=R_0da49e0


                                                 5
a9118ff35f52f629d2d71bf07&longUrl=http%3A%2F%2Fbetaworks.com%2F&

                                 format=txt

                                 http://bit.ly/cmeH01

	
  

	
  
                                                                                                                                                                                                                                                                          	
  


                                                                	
  

                          	
                                                                                     	
                             	
  

                   	
  

                   	
   	
  

               •                                	
                                                                                                                                                                                                   	
  

                                                                                     	
            	
               	
  

               •                                       	
                 ⼀一                                                      	
                                                        	
                                                              	
     	
  

                                                                                                          	
  

               •                        	
             ⼀一                                                                  	
                                  	
                    	
                        	
                 	
                 	
                   	
   	
  

                   	
   	
  

               •                                                                                                                                                                                                      	
   	
  

               •                                                                                                 ⾼高                                           	
  

       ⼒力力	
   	
  

               •                                               	
                           	
                                                                           	
   	
  

               •                        	
                                                                                                             	
   	
  

               •                                                       	
                                                                	
  

               •                                                              	
                                                                                                                   	
   	
  

               •                         	
                                                                                                                                                                                                ⽣生

                                                                                                                                                                      	
   	
  

               •                                        	
                                                                                                                                                                               	
   	
  

	
  

       	
   	
  

               •                 json
                                 http://api.bit.ly/v3/expand?shortUrl=http%3A%2F%2Ftcrn.ch%2Fa4MS

                                 UH&shortUrl=http%3A%2F%2Fbit.ly%2F1YKMfY&login=bitlyapidemo&apiK




                                                                                                                                  6
ey=R_0da49e0a9118ff35f52f629d2d71bf07&hash=j3&hash=a35.&format=j

son

{

      "status_code": 200,

      "data": {

           "expand": [

               {

                    "short_url": "http://tcrn.ch/a4MSUH",

                    "global_hash": "bWw49z",

                    "long_url":

"http://www.techcrunch.com/2010/01/29/windows-mobile-foursquare/

",

                    "user_hash": "a4MSUH"

               },

               {

                    "short_url": "http://bit.ly/1YKMfY",

                    "global_hash": "1YKMfY",

                    "long_url": "http://betaworks.com/",

                    "user_hash": "1YKMfY"

               },

               {

                    "long_url": "http://www.scotster.com/qf/?1152",

                    "global_hash": "lLWr",

                    "hash": "j3",

                    "user_hash": "j3"

               },

               {

                    "hash": "a35.",

                    "error": "NOT_FOUND"

               }

           ]

      },




                                    7
"status_txt": "OK"

    }

•   xml
    http://api.bit.ly/v3/expand?shortUrl=http%3A%2F%2Ftcrn.ch%2Fa4MS

    UH&shortUrl=http%3A%2F%2Fbit.ly%2F1YKMfY&login=bitlyapidemo&apiK

    ey=R_0da49e0a9118ff35f52f629d2d71bf07&hash=j3&hash=a35.&format=x

    ml

    <?xml version="1.0" encoding="UTF-8"?>

    <response>

          <status_code>200</status_code>

          <status_txt>OK</status_txt>

          <data>

             <entry>

                   <short_url>http://tcrn.ch/a4MSUH</short_url>

                   <long_url>http://www.techcrunch.com/2010/01/29/window

    s-mobile-foursquare/</long_url>

                   <user_hash>a4MSUH</user_hash>

                   <global_hash>bWw49z</global_hash>

             </entry>

             <entry>

                   <short_url>http://bit.ly/1YKMfY</short_url>

                   <long_url>http://betaworks.com/</long_url>

                   <user_hash>1YKMfY</user_hash>

                   <global_hash>1YKMfY</global_hash>

             </entry>

             <entry>

                   <hash>j3</hash>

                   <long_url>http://www.scotster.com/qf/?1152</long_url>

                   <user_hash>j3</user_hash>

                   <global_hash>lLWr</global_hash>

             </entry>

             <entry>

                   <error>NOT_FOUND</error>


                                     8
<hash>a35.</hash>

                </entry>

           </data>

    </response>

•   json
    http://api.bit.ly/v3/expand?shortUrl=http%3A%2F%2Fbit.ly%2F31IqM

    l&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&f

    ormat=json

    {

           "status_code": 200,

           "data": {

                "expand": [

                     {

                          "short_url": "http://bit.ly/31IqMl",

                          "global_hash": "31IqMl",

                          "long_url": "http://cnn.com/",

                          "user_hash": "31IqMl"

                     }

                ]

           },

           "status_txt": "OK"

    }

•   xml
    http://api.bit.ly/v3/expand?shortUrl=http%3A%2F%2Fbit.ly%2F31IqM

    l&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&f

    ormat=xml

    <?xml version="1.0" encoding="UTF-8"?>

    <response>

           <status_code>200</status_code>

           <status_txt>OK</status_txt>

           <data>

                <entry>

                     <short_url>http://bit.ly/31IqMl</short_url>


                                         9
<long_url>http://cnn.com/</long_url>

                                                                    <user_hash>31IqMl</user_hash>

                                                                    <global_hash>31IqMl</global_hash>

                                                      </entry>

                                  </data>

                         </response>

            •            txt
                         http://api.bit.ly/v3/expand?shortUrl=http%3A%2F%2Fbit.ly%2F31IqM

                         l&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&f

                         ormat=txt

                         http://cnn.com/

	
  
                                                                                                                                                 	
  


                                                             	
  

                                                                                                                                            	
   	
  

             	
   	
  

            •                               	
                                  	
                                                        	
  

                                                                         	
               	
     	
  

            •                                  	
                                                                 ⽤用          	
  

            •                                         	
                               	
                    ⽤用        	
  

       ⼒力力	
   	
  

            •                        	
                                                                                              ⽰示

                                	
   	
  



            •            json
                         http://api.bit.ly/v3/validate?x_login=notbilytapi&x_apiKey=not_a

                         pikey&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&login=bitlyapide

                         mo&format=json

                         {

                                  "status_code": 200,

                                  "data": {




                                                                                                        10
"valid": 0

                         },

                         "status_txt": "OK"

                   }

       •           xml
                   http://api.bit.ly/v3/validate?x_login=notbilytapi&x_apiKey=not_a

                   pikey&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&login=bitlyapide

                   mo&format=xml

                   <?xml version="1.0" encoding="UTF-8"?>

                   <response>

                         <status_code>200</status_code>

                         <status_txt>OK</status_txt>

                         <data>

                                            <valid>0</valid>

                         </data>

                   </response>

       •           txt
                   http://api.bit.ly/v3/validate?x_login=notbilytapi&x_apiKey=not_a

                   pikey&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&login=bitlyapide

                   mo&format=txt

                   0

	
  
                                                                                                                            	
  


                                     	
  

⼀一                                                      	
  

                         	
   	
  

       	
   	
  

       •                             	
                               	
                                                    	
  

                                                               	
                   	
   	
  

       •                                    	
     ⼀一                                           	
     	
     	
     	
  

                                                                             	
  




                                                                                                11
•                   	
      ⼀一                                              	
                         	
                    	
                 	
                 	
                             	
     	
   	
  

                  	
  

      	
   	
  

     •                                                                                                                                                      	
   	
  

     •                                                                      ⾼高                             	
  

⼒力力	
   	
  

     •                            	
                                 	
                                               	
   	
  

     •                   	
                                                                         	
   	
  

     •                                   	
                                                  	
  

     •                                                 	
                                                                                	
   	
  

     •                                          	
                                                                                                                             	
   	
  

     •                                                        	
                                                                                                                           	
   	
  

     •                    	
                                                                                                                                                                      ⽣生

                                                                                                                   	
   	
  



     •            json

                  http://api.bit.ly/v3/clicks?shortUrl=http%3A%2F%2Ftcrn.ch%2Fa4MS

                  UH&shortUrl=http%3A%2F%2Fbit.ly%2F1YKMfY&login=bitlyapidemo&apiK

                  ey=R_0da49e0a9118ff35f52f629d2d71bf07&hash=j3&hash=a35.&format=j

                  son

                  {

                         "status_code": 200,

                         "data": {

                                 "clicks": [

                                                        {

                                                                     "short_url": "http://tcrn.ch/a4MSUH",

                                                                     "global_hash": "bWw49z",

                                                                     "user_clicks": 0,

                                                                     "user_hash": "a4MSUH",

                                                                     "global_clicks": 1105

                                                        },

                                                        {




                                                                                        12
"short_url": "http://bit.ly/1YKMfY",

                        "global_hash": "1YKMfY",

                        "user_clicks": 2218,

                        "user_hash": "1YKMfY",

                        "global_clicks": 2218

                   },

                   {

                        "hash": "j3",

                        "global_hash": "lLWr",

                        "user_clicks": 105,

                        "user_hash": "j3",

                        "global_clicks": 106

                   },

                   {

                        "hash": "a35.",

                        "error": "NOT_FOUND"

                   }

               ]

          },

          "status_txt": "OK"

    }

•   xml
    http://api.bit.ly/v3/clicks?shortUrl=http%3A%2F%2Ftcrn.ch%2Fa4MS

    UH&shortUrl=http%3A%2F%2Fbit.ly%2F1YKMfY&login=bitlyapidemo&apiK

    ey=R_0da49e0a9118ff35f52f629d2d71bf07&hash=j3&hash=a35.&format=x

    ml

    <?xml version="1.0" encoding="UTF-8"?>

    <response>

          <status_code>200</status_code>

          <data>

               <clicks>

                   <short_url>http://tcrn.ch/a4MSUH</short_url>

                   <global_hash>bWw49z</global_hash>


                                        13
<user_clicks>0</user_clicks>

                     <user_hash>a4MSUH</user_hash>

                     <global_clicks>1105</global_clicks>

              </clicks>

              <clicks>

                     <short_url>http://bit.ly/1YKMfY</short_url>

                     <global_hash>1YKMfY</global_hash>

                     <user_clicks>2218</user_clicks>

                     <user_hash>1YKMfY</user_hash>

                     <global_clicks>2218</global_clicks>

              </clicks>

              <clicks>

                     <user_clicks>105</user_clicks>

                     <global_hash>lLWr</global_hash>

                     <hash>j3</hash>

                     <user_hash>j3</user_hash>

                     <global_clicks>106</global_clicks>

              </clicks>

              <clicks>

                     <hash>a35.</hash>

                     <error>NOT_FOUND</error>

              </clicks>

          </data>

          <status_txt>OK</status_txt>

       </response>

	
  

	
  
                                                                   	
  


                              	
  




                                         14
⽤用

                                            ⽤用                                  ⽤用

                                                                  ⽂文                                                	
   	
  

      	
   	
  

     •                               	
                                              	
                 	
   	
  

     •                        	
                                  	
                                                                             	
  

                                                           	
            	
  

⼒力力	
   	
  

     •                                              	
                                                                          ⽰示   	
   	
  

     •                               	
                                                     	
   	
  



     •            json
                  http://api.bit.ly/v3/bitly_pro_domain?domain=nyti.ms&apiKey=R_0d

                  a49e0a9118ff35f52f629d2d71bf07&login=bitlyapidemo&format=json

                  {

                         "status_code": 200,

                         "data": {

                                            "domain": "nyti.ms",

                                            "bitly_pro_domain": 1

                         },

                         "status_txt": "OK"

                  }

     •            xml

                  http://api.bit.ly/v3/bitly_pro_domain?domain=nyti.ms&apiKey=R_0d

                  a49e0a9118ff35f52f629d2d71bf07&login=bitlyapidemo&format=xml

                  <?xml version="1.0" encoding="UTF-8"?>

                  <response>

                         <status_code>200</status_code>

                         <data>

                                            <domain>nyti.ms</domain>

                                            <bitly_pro_domain>1</bitly_pro_domain>

                         </data>




                                                                                     15
<status_txt>OK</status_txt>

                         </response>

	
  

	
  
                                                                                                                                                 	
  


                                              	
  

                                                                                                                                ⽤用

                                                                                                                           ⽤用        	
   	
  

             	
   	
  

            •                	
   ⼀一                                                               	
   	
  

            •                          	
                                	
                                                                      	
  

                                                               	
                           	
  

             	
   	
  

            •                                                                   	
   	
  

       ⼒力力	
   	
  

            •                	
                                   	
  

            •                                    	
                                                            	
   	
  



            •            json
                         http://api.bit.ly/v3/lookup?url=http%3A%2F%2Fbetaworks.com%2F&ur

                         l=http%3A%2F%2Fcode.google.com%2Fp%2Fbitly-api%2F&login=bitlyapi

                         demo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&format=json

                         {

                                    "data": {

                                              "lookup": [

                                                        {

                                                             "global_hash": "beta",

                                                             "short_url": "http://bit.ly/beta",

                                                             "url": "http://betaworks.com/"

                                                        },

                                                        {




                                                                                                                      16
"global_hash": "1oDCU",

                         "short_url": "http://bit.ly/1oDCU",

                         "url": "http://code.google.com/p/bitly-api/"

                     }

                ]

           },

           "status_code": 200,

           "status_txt": "OK"

    }

•   xml
    http://api.bit.ly/v3/lookup?url=http%3A%2F%2Fbetaworks.com%2F&ur

    l=http%3A%2F%2Fcode.google.com%2Fp%2Fbitly-api%2F&login=bitlyapi

    demo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&format=xml

    <?xml version="1.0" encoding="UTF-8"?>

    <response>

           <status_code>200</status_code>

           <data>

                <lookup>

                     <url>http://betaworks.com/</url>

                     <short_url>http://bit.ly/beta</short_url>

                     <global_hash>beta</global_hash>

                </lookup>

                <lookup>

                     <url>http://code.google.com/p/bitly-api/</url>

                     <short_url>http://bit.ly/1oDCU</short_url>

                     <global_hash>1oDCU</global_hash>

                </lookup>

           </data>

           <status_txt>OK</status_txt>

    </response>

•   json
    http://api.bit.ly/v3/lookup?url=asdf%3A%2F%2Fwww.google.com%2Fno




                                      17
t%2Fa%2Freal%2Flink&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35

           f52f629d2d71bf07&format=json

           {

                 "data": {

                      "lookup": [

                           {

                               "error": "NOT_FOUND",

                               "url": "asdf://www.google.com/not/a/real/link"

                           }

                      ]

                 },

                 "status_code": 200,

                 "status_txt": "OK"

           }

       •   xml
           http://api.bit.ly/v3/lookup?url=asdf%3A%2F%2Fwww.google.com%2Fno

           t%2Fa%2Freal%2Flink&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35

           f52f629d2d71bf07&format=xml

           <?xml version="1.0" encoding="UTF-8"?>

           <response>

                 <status_code>200</status_code>

                 <data>

                      <lookup>

                           <url>asdf://www.google.com/not/a/real/link</url>

                           <error>NOT_FOUND</error>

                      </lookup>

                 </data>

                 <status_txt>OK</status_txt>

           </response>

	
  

	
  
                                                                                	
  




                                            18
 

                                                                                                                          	
                 	
                                                     ⽤用

                           	
   	
  

                                                                                                                                                                            	
          	
  



                                                                  ⽤用⽅方                                                                              ⼀一                                               	
   	
  

          	
   	
  

         •                                	
                                                                                                                    	
   	
  

         •                                                       	
                                         	
  

         •                             	
                                                	
                                                                                                              	
  

                                                                                	
              	
  

          	
   	
  

         •                                                                             	
                          	
  

                                                     	
   	
  

    ⼒力力	
   	
  

         •                                               	
                                                                                                                        ⽰示   	
   	
  

         •                                             	
                                                                                           	
   	
  

         •                                    	
                                                                                 	
   	
  



         •            json                       http://api.bit.ly/v3/authenticate

POST:

x_login=bitlyapidemo&x_password=bad-password&apiKey=R_0da49e0a9118ff35

f52f629d2d71bf07&login=bitlyapidemo&format=json

{

            "data": {

                       "authenticate": {

                                       "successful": false

                       }

            },

            "status_code": 200,




                                                                                                       19
"status_txt": "OK"

}

    •    xml      http://api.bit.ly/v3/authenticate

POST:

x_login=bitlyapidemo&x_password=bad-password&apiKey=R_0da49e0a9118ff35

f52f629d2d71bf07&login=bitlyapidemo&format=xml

<?xml version="1.0" encoding="UTF-8"?>

<response>

    <status_code>200</status_code>

    <data>

          <authenticate>

                <successful>0</successful>

          </authenticate>

    </data>

    <status_txt>OK</status_txt>

</response>

    •    json     http://api.bit.ly/v3/authenticate

POST:

x_login=bitlyapidemo&x_password=good-password&apiKey=R_0da49e0a9118ff3

5f52f629d2d71bf07&login=bitlyapidemo&format=json

{

    "data": {

          "authenticate": {

                "api_key": "R_0da49e0a9118ff35f52f629d2d71bf07",

                "successful": true,

                "username": "bitlyapidemo"

          }

    },

    "status_code": 200,

    "status_txt": "OK"

}

    •    xml      http://api.bit.ly/v3/authenticate




                                       20
POST:

x_login=bitlyapidemo&x_password=good-password&apiKey=R_0da49e0a9118ff3

5f52f629d2d71bf07&login=bitlyapidemo&format=xml

<?xml version="1.0" encoding="UTF-8"?>

<response>

               <status_code>200</status_code>

               <data>

                         <authenticate>

                                  <username>bitlyapidemo</username>

                                  <successful>1</successful>

                                  <api_key>R_0da49e0a9118ff35f52f629d2d71bf07</api_key>

                         </authenticate>

               </data>

               <status_txt>OK</status_txt>

</response>

	
  

	
  
                                                                                                                                                                                                                      	
  


                           	
  

                                                                                                                           ⽤用                             	
   	
  

             	
   	
  

            •                     	
                                      	
                                                                                                                                   	
  

                                                                   	
                   	
            	
  

            •                            	
            ⼀一                                                    	
                                    	
                                                  	
     	
  

                                                                                 	
  

            •              	
            ⼀一                                                    	
                   	
                      	
                        	
                 	
     	
                   	
  

             	
   	
  

            •                                                                                                                                                                	
   	
  

            •                                                                             ⾼高                        	
  

       ⼒力力	
   	
  

            •                                   	
          	
                                                                  	
   	
  




                                                                                                             21
•                 	
                                                                     	
   	
  

•                          	
                                                     	
  

•                                        	
                                                                      	
   	
  

•                  	
                                                                                                                    ⽣生

                                                                                                     	
   	
  

•          	
                                           	
     	
          	
                                                     	
  

•                                 	
                                                                                         	
   	
  



•   json
    http://api.bit.ly/v3/info?shortUrl=http%3A%2F%2Ftcrn.ch%2Fa4MSUH

    &shortUrl=http%3A%2F%2Fbit.ly%2F1YKMfY&login=bitlyapidemo&apiKey

    =R_0da49e0a9118ff35f52f629d2d71bf07&hash=j3&hash=a.35&format=jso

    n

    {

            "data": {

                          "info": [

                                          {

                                                "created_by": "scotster",

                                                "global_hash": "lLWr",

                                                "hash": "j3",

                                                "title": null,

                                                "user_hash": "j3"

                                          },

                                          {

                                                "error": "NOT_FOUND",

                                                "hash": "a.35"

                                          },

                                          {

                                                "created_by": "j3h14h",

                                                "global_hash": "bWw49z",

                                                "short_url": "http://tcrn.ch/a4MSUH",

                                                "title": "Windows Mobile Finally Checks Out

    Foursquare",


                                                                      22
"user_hash": "a4MSUH"

                   },

                   {

                         "created_by": "bitly",

                         "global_hash": "1YKMfY",

                         "short_url": "http://bit.ly/1YKMfY",

                         "title": null,

                         "user_hash": "1YKMfY"

                   }

               ]

          },

          "status_code": 200,

          "status_txt": "OK"

    }

•   xml
    http://api.bit.ly/v3/info?shortUrl=http%3A%2F%2Ftcrn.ch%2Fa4MSUH

    &shortUrl=http%3A%2F%2Fbit.ly%2F1YKMfY&login=bitlyapidemo&apiKey

    =R_0da49e0a9118ff35f52f629d2d71bf07&hash=j3&hash=a.35&format=xml

    <?xml version="1.0" encoding="UTF-8"?>

    <response>

          <status_code>200</status_code>

          <data>

               <info>

                   <global_hash>lLWr</global_hash>

                   <hash>j3</hash>

                   <user_hash>j3</user_hash>

                   <created_by>scotster</created_by>

                   <title/>

               </info>

               <info>

                   <hash>a.35</hash>

                   <error>NOT_FOUND</error>

               </info>


                                       23
<info>

                     <short_url>http://tcrn.ch/a4MSUH</short_url>

                     <global_hash>bWw49z</global_hash>

                     <user_hash>a4MSUH</user_hash>

                     <created_by>j3h14h</created_by>

                     <title>Windows Mobile Finally Checks Out

       Foursquare</title>

              </info>

              <info>

                     <short_url>http://bit.ly/1YKMfY</short_url>

                     <global_hash>1YKMfY</global_hash>

                     <user_hash>1YKMfY</user_hash>

                     <created_by>bitly</created_by>

                     <title/>

              </info>

          </data>

          <status_txt>OK</status_txt>

       </response>


	
  




                                      24

Contenu connexe

En vedette

❸ 保存する Szmk
❸ 保存する Szmk❸ 保存する Szmk
❸ 保存する SzmkOrinoco K.K.
 
Gestaltprincipper for visuel perception oplæg 30.06.2011
Gestaltprincipper for visuel perception oplæg 30.06.2011Gestaltprincipper for visuel perception oplæg 30.06.2011
Gestaltprincipper for visuel perception oplæg 30.06.2011jwinther
 
❸ 保存する Alchemist
❸ 保存する Alchemist❸ 保存する Alchemist
❸ 保存する AlchemistOrinoco K.K.
 
事例に学ぶ、フェイスブック ファンページ (Facebook Fanpage)のベストプラクティスとは?
事例に学ぶ、フェイスブック ファンページ (Facebook Fanpage)のベストプラクティスとは?事例に学ぶ、フェイスブック ファンページ (Facebook Fanpage)のベストプラクティスとは?
事例に学ぶ、フェイスブック ファンページ (Facebook Fanpage)のベストプラクティスとは?Orinoco K.K.
 
Marketing concept of today
Marketing concept of todayMarketing concept of today
Marketing concept of todaydipikasingh
 

En vedette (7)

❸ 保存する Szmk
❸ 保存する Szmk❸ 保存する Szmk
❸ 保存する Szmk
 
Gestaltprincipper for visuel perception oplæg 30.06.2011
Gestaltprincipper for visuel perception oplæg 30.06.2011Gestaltprincipper for visuel perception oplæg 30.06.2011
Gestaltprincipper for visuel perception oplæg 30.06.2011
 
❸ 保存する Alchemist
❸ 保存する Alchemist❸ 保存する Alchemist
❸ 保存する Alchemist
 
Midemlab 2013
Midemlab  2013Midemlab  2013
Midemlab 2013
 
事例に学ぶ、フェイスブック ファンページ (Facebook Fanpage)のベストプラクティスとは?
事例に学ぶ、フェイスブック ファンページ (Facebook Fanpage)のベストプラクティスとは?事例に学ぶ、フェイスブック ファンページ (Facebook Fanpage)のベストプラクティスとは?
事例に学ぶ、フェイスブック ファンページ (Facebook Fanpage)のベストプラクティスとは?
 
Pea tix live_0901
Pea tix live_0901Pea tix live_0901
Pea tix live_0901
 
Marketing concept of today
Marketing concept of todayMarketing concept of today
Marketing concept of today
 

Similaire à bit.ly APIについての (20)

삶과학습의 경계를 허물다 박춘원
삶과학습의 경계를 허물다   박춘원삶과학습의 경계를 허물다   박춘원
삶과학습의 경계를 허물다 박춘원
 
Plomo salud y ambiente estudio base
Plomo salud y ambiente estudio basePlomo salud y ambiente estudio base
Plomo salud y ambiente estudio base
 
Kiawah map
Kiawah mapKiawah map
Kiawah map
 
6325
63256325
6325
 
6346
63466346
6346
 
6120
61206120
6120
 
Social media Strategy - Expansion plus
Social media Strategy - Expansion plusSocial media Strategy - Expansion plus
Social media Strategy - Expansion plus
 
6290
62906290
6290
 
Uv a map_feb2006
Uv a map_feb2006Uv a map_feb2006
Uv a map_feb2006
 
6377
63776377
6377
 
6181
61816181
6181
 
6181
61816181
6181
 
6334
63346334
6334
 
5266
52665266
5266
 
Mapajunin
MapajuninMapajunin
Mapajunin
 
Callejero icod
Callejero icodCallejero icod
Callejero icod
 
6375
63756375
6375
 
Ejercicios de stacato
Ejercicios de stacatoEjercicios de stacato
Ejercicios de stacato
 
6380
63806380
6380
 
6385
63856385
6385
 

Plus de Orinoco K.K.

Midem2013 presentation Tokyo
Midem2013 presentation TokyoMidem2013 presentation Tokyo
Midem2013 presentation TokyoOrinoco K.K.
 
June2012 event-design-workshop-instructors
June2012 event-design-workshop-instructorsJune2012 event-design-workshop-instructors
June2012 event-design-workshop-instructorsOrinoco K.K.
 
無料から使える傾聴ツール8選
無料から使える傾聴ツール8選無料から使える傾聴ツール8選
無料から使える傾聴ツール8選Orinoco K.K.
 
Lessons from midem feb2012
Lessons from midem feb2012Lessons from midem feb2012
Lessons from midem feb2012Orinoco K.K.
 
2012 mar event-design-workshop-instructors
2012 mar event-design-workshop-instructors2012 mar event-design-workshop-instructors
2012 mar event-design-workshop-instructorsOrinoco K.K.
 
PeaTiX (ピーティックス) って何?
PeaTiX (ピーティックス) って何?PeaTiX (ピーティックス) って何?
PeaTiX (ピーティックス) って何?Orinoco K.K.
 
流通系ブランド ファンページ 事例集
流通系ブランド ファンページ 事例集流通系ブランド ファンページ 事例集
流通系ブランド ファンページ 事例集Orinoco K.K.
 
❸ 保存する Pe'z
❸ 保存する Pe'z❸ 保存する Pe'z
❸ 保存する Pe'zOrinoco K.K.
 
Facebook公式ファンページ:米国事例から学ぶベストプラクティスとは?
Facebook公式ファンページ:米国事例から学ぶベストプラクティスとは?Facebook公式ファンページ:米国事例から学ぶベストプラクティスとは?
Facebook公式ファンページ:米国事例から学ぶベストプラクティスとは?Orinoco K.K.
 
❶ 聴く Alchemist
❶ 聴く Alchemist❶ 聴く Alchemist
❶ 聴く AlchemistOrinoco K.K.
 
❶ 聴く Alchemist
❶ 聴く Alchemist❶ 聴く Alchemist
❶ 聴く AlchemistOrinoco K.K.
 

Plus de Orinoco K.K. (14)

Midem2013 presentation Tokyo
Midem2013 presentation TokyoMidem2013 presentation Tokyo
Midem2013 presentation Tokyo
 
June2012 event-design-workshop-instructors
June2012 event-design-workshop-instructorsJune2012 event-design-workshop-instructors
June2012 event-design-workshop-instructors
 
無料から使える傾聴ツール8選
無料から使える傾聴ツール8選無料から使える傾聴ツール8選
無料から使える傾聴ツール8選
 
Lessons from midem feb2012
Lessons from midem feb2012Lessons from midem feb2012
Lessons from midem feb2012
 
2012 mar event-design-workshop-instructors
2012 mar event-design-workshop-instructors2012 mar event-design-workshop-instructors
2012 mar event-design-workshop-instructors
 
PeaTiX (ピーティックス) って何?
PeaTiX (ピーティックス) って何?PeaTiX (ピーティックス) って何?
PeaTiX (ピーティックス) って何?
 
Orinoco excerpt
Orinoco excerptOrinoco excerpt
Orinoco excerpt
 
流通系ブランド ファンページ 事例集
流通系ブランド ファンページ 事例集流通系ブランド ファンページ 事例集
流通系ブランド ファンページ 事例集
 
❸ 保存する Pe'z
❸ 保存する Pe'z❸ 保存する Pe'z
❸ 保存する Pe'z
 
❷ 買う Pe'z
❷ 買う Pe'z❷ 買う Pe'z
❷ 買う Pe'z
 
❶ 聴く Pe'z
❶ 聴く Pe'z❶ 聴く Pe'z
❶ 聴く Pe'z
 
Facebook公式ファンページ:米国事例から学ぶベストプラクティスとは?
Facebook公式ファンページ:米国事例から学ぶベストプラクティスとは?Facebook公式ファンページ:米国事例から学ぶベストプラクティスとは?
Facebook公式ファンページ:米国事例から学ぶベストプラクティスとは?
 
❶ 聴く Alchemist
❶ 聴く Alchemist❶ 聴く Alchemist
❶ 聴く Alchemist
 
❶ 聴く Alchemist
❶ 聴く Alchemist❶ 聴く Alchemist
❶ 聴く Alchemist
 

bit.ly APIについての

  • 1.                                           ⽰示           ⽤用 ⽤用           ⽤用       1
  • 2. ⾏行行   •             •       ⽤用 ⽂文     •   ⽤用 ⼀一 ⽤用     •   ⽣生 ⽰示 ⽰示 ⾼高       ⽰示         • json { "status_code": 200, "status_txt": "OK", "data" : ... } • json { "status_code": 403, "status_txt": "RATE_LIMIT_EXCEEDED", "data" : null } • json { "status_code": 500, "status_txt": "INVALID_URI", "data" : null } • json { "status_code": 500, "status_txt": "MISSING_ARG_LOGIN", "data" : null } • json { "status_code": 503, "status_txt": "UNKNOWN_ERROR", "data" : null } • jsonp callback_method({ "status_code": 200, "status_txt": "OK", "data" : ... }) • xml <?xml version="1.0" encoding="UTF-8"?> <response> <status_code>200</status_code> 2
  • 3. <status_txt>OK</status_txt> <data> ... </data> </response>     ⽤用   ⽤用 ⼀一 ⽤用     ⽤用 ⼗十 ⽤用   ⽤用 ⽤用 ⽣生   ⽤用 ⽤用     ⾼高 ⽤用   ⽤用 ⾼高 ⽤用       ⽤用⽅方 ⽤用 ⽤用             ⻑⾧長           •             •       3
  • 4.     ⼒力力     •     ⽤用     •     ⽤用   ⽤用       •             • ⽩白 ⽤用 ⽩白 ⽩白 ⾏行行 ⽩白 ⽩白 ⾏行行     •       •     ⼒力力     •       •     ⽤用     •       •   ⽰示 ⽤用     •           4
  • 5.   http://api.bit.ly/v3/shorten?login=bitlyapidemo&apiKey=R_0da49e0 a9118ff35f52f629d2d71bf07&longUrl=http%3A%2F%2Fbetaworks.com%2F& format=json { "status_code": 200, "data": { "url": "http://bit.ly/cmeH01", "hash": "cmeH01", "global_hash": "1YKMfY", "long_url": "http://betaworks.com/", "new_hash": 0 }, "status_txt": "OK" } •   http://api.bit.ly/v3/shorten?login=bitlyapidemo&apiKey=R_0da49e0 a9118ff35f52f629d2d71bf07&longUrl=http%3A%2F%2Fbetaworks.com%2F& format=xml <?xml version="1.0" encoding="UTF-8"?> <response> <status_code>200</status_code> <status_txt>OK</status_txt> <data> <url>http://bit.ly/cmeH01</url> <hash>cmeH01</hash> <global_hash>1YKMfY</global_hash> <long_url>http://betaworks.com/</long_url> <new_hash>0</new_hash> </data> </response> •   http://api.bit.ly/v3/shorten?login=bitlyapidemo&apiKey=R_0da49e0 5
  • 6. a9118ff35f52f629d2d71bf07&longUrl=http%3A%2F%2Fbetaworks.com%2F& format=txt http://bit.ly/cmeH01                     •           •   ⼀一           •   ⼀一                     •     • ⾼高   ⼒力力     •         •       •     •       •   ⽣生     •             • json http://api.bit.ly/v3/expand?shortUrl=http%3A%2F%2Ftcrn.ch%2Fa4MS UH&shortUrl=http%3A%2F%2Fbit.ly%2F1YKMfY&login=bitlyapidemo&apiK 6
  • 7. ey=R_0da49e0a9118ff35f52f629d2d71bf07&hash=j3&hash=a35.&format=j son { "status_code": 200, "data": { "expand": [ { "short_url": "http://tcrn.ch/a4MSUH", "global_hash": "bWw49z", "long_url": "http://www.techcrunch.com/2010/01/29/windows-mobile-foursquare/ ", "user_hash": "a4MSUH" }, { "short_url": "http://bit.ly/1YKMfY", "global_hash": "1YKMfY", "long_url": "http://betaworks.com/", "user_hash": "1YKMfY" }, { "long_url": "http://www.scotster.com/qf/?1152", "global_hash": "lLWr", "hash": "j3", "user_hash": "j3" }, { "hash": "a35.", "error": "NOT_FOUND" } ] }, 7
  • 8. "status_txt": "OK" } • xml http://api.bit.ly/v3/expand?shortUrl=http%3A%2F%2Ftcrn.ch%2Fa4MS UH&shortUrl=http%3A%2F%2Fbit.ly%2F1YKMfY&login=bitlyapidemo&apiK ey=R_0da49e0a9118ff35f52f629d2d71bf07&hash=j3&hash=a35.&format=x ml <?xml version="1.0" encoding="UTF-8"?> <response> <status_code>200</status_code> <status_txt>OK</status_txt> <data> <entry> <short_url>http://tcrn.ch/a4MSUH</short_url> <long_url>http://www.techcrunch.com/2010/01/29/window s-mobile-foursquare/</long_url> <user_hash>a4MSUH</user_hash> <global_hash>bWw49z</global_hash> </entry> <entry> <short_url>http://bit.ly/1YKMfY</short_url> <long_url>http://betaworks.com/</long_url> <user_hash>1YKMfY</user_hash> <global_hash>1YKMfY</global_hash> </entry> <entry> <hash>j3</hash> <long_url>http://www.scotster.com/qf/?1152</long_url> <user_hash>j3</user_hash> <global_hash>lLWr</global_hash> </entry> <entry> <error>NOT_FOUND</error> 8
  • 9. <hash>a35.</hash> </entry> </data> </response> • json http://api.bit.ly/v3/expand?shortUrl=http%3A%2F%2Fbit.ly%2F31IqM l&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&f ormat=json { "status_code": 200, "data": { "expand": [ { "short_url": "http://bit.ly/31IqMl", "global_hash": "31IqMl", "long_url": "http://cnn.com/", "user_hash": "31IqMl" } ] }, "status_txt": "OK" } • xml http://api.bit.ly/v3/expand?shortUrl=http%3A%2F%2Fbit.ly%2F31IqM l&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&f ormat=xml <?xml version="1.0" encoding="UTF-8"?> <response> <status_code>200</status_code> <status_txt>OK</status_txt> <data> <entry> <short_url>http://bit.ly/31IqMl</short_url> 9
  • 10. <long_url>http://cnn.com/</long_url> <user_hash>31IqMl</user_hash> <global_hash>31IqMl</global_hash> </entry> </data> </response> • txt http://api.bit.ly/v3/expand?shortUrl=http%3A%2F%2Fbit.ly%2F31IqM l&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&f ormat=txt http://cnn.com/               •             •   ⽤用   •     ⽤用   ⼒力力     •   ⽰示     • json http://api.bit.ly/v3/validate?x_login=notbilytapi&x_apiKey=not_a pikey&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&login=bitlyapide mo&format=json { "status_code": 200, "data": { 10
  • 11. "valid": 0 }, "status_txt": "OK" } • xml http://api.bit.ly/v3/validate?x_login=notbilytapi&x_apiKey=not_a pikey&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&login=bitlyapide mo&format=xml <?xml version="1.0" encoding="UTF-8"?> <response> <status_code>200</status_code> <status_txt>OK</status_txt> <data> <valid>0</valid> </data> </response> • txt http://api.bit.ly/v3/validate?x_login=notbilytapi&x_apiKey=not_a pikey&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&login=bitlyapide mo&format=txt 0       ⼀一           •             •   ⼀一           11
  • 12.   ⼀一                       •     • ⾼高   ⼒力力     •         •       •     •       •       •       •   ⽣生     • json http://api.bit.ly/v3/clicks?shortUrl=http%3A%2F%2Ftcrn.ch%2Fa4MS UH&shortUrl=http%3A%2F%2Fbit.ly%2F1YKMfY&login=bitlyapidemo&apiK ey=R_0da49e0a9118ff35f52f629d2d71bf07&hash=j3&hash=a35.&format=j son { "status_code": 200, "data": { "clicks": [ { "short_url": "http://tcrn.ch/a4MSUH", "global_hash": "bWw49z", "user_clicks": 0, "user_hash": "a4MSUH", "global_clicks": 1105 }, { 12
  • 13. "short_url": "http://bit.ly/1YKMfY", "global_hash": "1YKMfY", "user_clicks": 2218, "user_hash": "1YKMfY", "global_clicks": 2218 }, { "hash": "j3", "global_hash": "lLWr", "user_clicks": 105, "user_hash": "j3", "global_clicks": 106 }, { "hash": "a35.", "error": "NOT_FOUND" } ] }, "status_txt": "OK" } • xml http://api.bit.ly/v3/clicks?shortUrl=http%3A%2F%2Ftcrn.ch%2Fa4MS UH&shortUrl=http%3A%2F%2Fbit.ly%2F1YKMfY&login=bitlyapidemo&apiK ey=R_0da49e0a9118ff35f52f629d2d71bf07&hash=j3&hash=a35.&format=x ml <?xml version="1.0" encoding="UTF-8"?> <response> <status_code>200</status_code> <data> <clicks> <short_url>http://tcrn.ch/a4MSUH</short_url> <global_hash>bWw49z</global_hash> 13
  • 14. <user_clicks>0</user_clicks> <user_hash>a4MSUH</user_hash> <global_clicks>1105</global_clicks> </clicks> <clicks> <short_url>http://bit.ly/1YKMfY</short_url> <global_hash>1YKMfY</global_hash> <user_clicks>2218</user_clicks> <user_hash>1YKMfY</user_hash> <global_clicks>2218</global_clicks> </clicks> <clicks> <user_clicks>105</user_clicks> <global_hash>lLWr</global_hash> <hash>j3</hash> <user_hash>j3</user_hash> <global_clicks>106</global_clicks> </clicks> <clicks> <hash>a35.</hash> <error>NOT_FOUND</error> </clicks> </data> <status_txt>OK</status_txt> </response>         14
  • 15. ⽤用 ⽤用 ⽤用 ⽂文         •         •           ⼒力力     •   ⽰示     •       • json http://api.bit.ly/v3/bitly_pro_domain?domain=nyti.ms&apiKey=R_0d a49e0a9118ff35f52f629d2d71bf07&login=bitlyapidemo&format=json { "status_code": 200, "data": { "domain": "nyti.ms", "bitly_pro_domain": 1 }, "status_txt": "OK" } • xml http://api.bit.ly/v3/bitly_pro_domain?domain=nyti.ms&apiKey=R_0d a49e0a9118ff35f52f629d2d71bf07&login=bitlyapidemo&format=xml <?xml version="1.0" encoding="UTF-8"?> <response> <status_code>200</status_code> <data> <domain>nyti.ms</domain> <bitly_pro_domain>1</bitly_pro_domain> </data> 15
  • 16. <status_txt>OK</status_txt> </response>         ⽤用 ⽤用         •   ⼀一     •               •     ⼒力力     •     •       • json http://api.bit.ly/v3/lookup?url=http%3A%2F%2Fbetaworks.com%2F&ur l=http%3A%2F%2Fcode.google.com%2Fp%2Fbitly-api%2F&login=bitlyapi demo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&format=json { "data": { "lookup": [ { "global_hash": "beta", "short_url": "http://bit.ly/beta", "url": "http://betaworks.com/" }, { 16
  • 17. "global_hash": "1oDCU", "short_url": "http://bit.ly/1oDCU", "url": "http://code.google.com/p/bitly-api/" } ] }, "status_code": 200, "status_txt": "OK" } • xml http://api.bit.ly/v3/lookup?url=http%3A%2F%2Fbetaworks.com%2F&ur l=http%3A%2F%2Fcode.google.com%2Fp%2Fbitly-api%2F&login=bitlyapi demo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&format=xml <?xml version="1.0" encoding="UTF-8"?> <response> <status_code>200</status_code> <data> <lookup> <url>http://betaworks.com/</url> <short_url>http://bit.ly/beta</short_url> <global_hash>beta</global_hash> </lookup> <lookup> <url>http://code.google.com/p/bitly-api/</url> <short_url>http://bit.ly/1oDCU</short_url> <global_hash>1oDCU</global_hash> </lookup> </data> <status_txt>OK</status_txt> </response> • json http://api.bit.ly/v3/lookup?url=asdf%3A%2F%2Fwww.google.com%2Fno 17
  • 18. t%2Fa%2Freal%2Flink&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35 f52f629d2d71bf07&format=json { "data": { "lookup": [ { "error": "NOT_FOUND", "url": "asdf://www.google.com/not/a/real/link" } ] }, "status_code": 200, "status_txt": "OK" } • xml http://api.bit.ly/v3/lookup?url=asdf%3A%2F%2Fwww.google.com%2Fno t%2Fa%2Freal%2Flink&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35 f52f629d2d71bf07&format=xml <?xml version="1.0" encoding="UTF-8"?> <response> <status_code>200</status_code> <data> <lookup> <url>asdf://www.google.com/not/a/real/link</url> <error>NOT_FOUND</error> </lookup> </data> <status_txt>OK</status_txt> </response>       18
  • 19.       ⽤用         ⽤用⽅方 ⼀一         •       •     •               •         ⼒力力     •   ⽰示     •       •       • json http://api.bit.ly/v3/authenticate POST: x_login=bitlyapidemo&x_password=bad-password&apiKey=R_0da49e0a9118ff35 f52f629d2d71bf07&login=bitlyapidemo&format=json { "data": { "authenticate": { "successful": false } }, "status_code": 200, 19
  • 20. "status_txt": "OK" } • xml http://api.bit.ly/v3/authenticate POST: x_login=bitlyapidemo&x_password=bad-password&apiKey=R_0da49e0a9118ff35 f52f629d2d71bf07&login=bitlyapidemo&format=xml <?xml version="1.0" encoding="UTF-8"?> <response> <status_code>200</status_code> <data> <authenticate> <successful>0</successful> </authenticate> </data> <status_txt>OK</status_txt> </response> • json http://api.bit.ly/v3/authenticate POST: x_login=bitlyapidemo&x_password=good-password&apiKey=R_0da49e0a9118ff3 5f52f629d2d71bf07&login=bitlyapidemo&format=json { "data": { "authenticate": { "api_key": "R_0da49e0a9118ff35f52f629d2d71bf07", "successful": true, "username": "bitlyapidemo" } }, "status_code": 200, "status_txt": "OK" } • xml http://api.bit.ly/v3/authenticate 20
  • 21. POST: x_login=bitlyapidemo&x_password=good-password&apiKey=R_0da49e0a9118ff3 5f52f629d2d71bf07&login=bitlyapidemo&format=xml <?xml version="1.0" encoding="UTF-8"?> <response> <status_code>200</status_code> <data> <authenticate> <username>bitlyapidemo</username> <successful>1</successful> <api_key>R_0da49e0a9118ff35f52f629d2d71bf07</api_key> </authenticate> </data> <status_txt>OK</status_txt> </response>         ⽤用         •             •   ⼀一           •   ⼀一                   •     • ⾼高   ⼒力力     •         21
  • 22.       •     •       •   ⽣生     •           •       • json http://api.bit.ly/v3/info?shortUrl=http%3A%2F%2Ftcrn.ch%2Fa4MSUH &shortUrl=http%3A%2F%2Fbit.ly%2F1YKMfY&login=bitlyapidemo&apiKey =R_0da49e0a9118ff35f52f629d2d71bf07&hash=j3&hash=a.35&format=jso n { "data": { "info": [ { "created_by": "scotster", "global_hash": "lLWr", "hash": "j3", "title": null, "user_hash": "j3" }, { "error": "NOT_FOUND", "hash": "a.35" }, { "created_by": "j3h14h", "global_hash": "bWw49z", "short_url": "http://tcrn.ch/a4MSUH", "title": "Windows Mobile Finally Checks Out Foursquare", 22
  • 23. "user_hash": "a4MSUH" }, { "created_by": "bitly", "global_hash": "1YKMfY", "short_url": "http://bit.ly/1YKMfY", "title": null, "user_hash": "1YKMfY" } ] }, "status_code": 200, "status_txt": "OK" } • xml http://api.bit.ly/v3/info?shortUrl=http%3A%2F%2Ftcrn.ch%2Fa4MSUH &shortUrl=http%3A%2F%2Fbit.ly%2F1YKMfY&login=bitlyapidemo&apiKey =R_0da49e0a9118ff35f52f629d2d71bf07&hash=j3&hash=a.35&format=xml <?xml version="1.0" encoding="UTF-8"?> <response> <status_code>200</status_code> <data> <info> <global_hash>lLWr</global_hash> <hash>j3</hash> <user_hash>j3</user_hash> <created_by>scotster</created_by> <title/> </info> <info> <hash>a.35</hash> <error>NOT_FOUND</error> </info> 23
  • 24. <info> <short_url>http://tcrn.ch/a4MSUH</short_url> <global_hash>bWw49z</global_hash> <user_hash>a4MSUH</user_hash> <created_by>j3h14h</created_by> <title>Windows Mobile Finally Checks Out Foursquare</title> </info> <info> <short_url>http://bit.ly/1YKMfY</short_url> <global_hash>1YKMfY</global_hash> <user_hash>1YKMfY</user_hash> <created_by>bitly</created_by> <title/> </info> </data> <status_txt>OK</status_txt> </response>   24