※本APIの利用規約はTypeSquareの利用規約に準じます。
TypeSquare Web APIは、配信利用タグに記載された配信IDを使ってAPIキーを発行し、そのキーを使って登録URLの操作やPV、書体リストなどの情報を取得することができます。
機能
|
TypeSquare Web APIのAPIキー発行
|
URL
|
https://typesquare.com/api/auth
|
引数(POST)
|
id (必須) : 配信ID (typesquare.jsの引数)
password (必須) : パスワード |
戻り値(XML)
|
res_result : 処理結果ステータス(OK/NG)
api_key : APIキー |
エラーコード
|
0000:POSTデータ取得失敗
1101:API利用認証失敗 1102:API利用登録失敗 |
備考
|
認証後、APIに接続しないまま24時間が経過すると、セッションが切れます。
マイページのログインパスワードを変更すると本APIのpasswordパラメータの変更が必要です。 APIをシステム運用されている方はご注意ください。 |
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <form action="https://typesquare.com/api/auth/" method="post"> <p>id: <input type="text" name="id"></p> <p>password: <input type="password" name="password"></p> <p><input type="submit" name="submit" value="send"></p> </form> </body> </html>
配信IDとパスワードを入力してsendをクリックしてください。
機能
|
TypeSquareを利用するサイト(URL)の登録
|
URL
|
https://typesquare.com/api/service
|
引数(POST)
|
method : typesquare.regist.url
api_key : APIキー url_text : 登録URL |
戻り値(XML)
|
res_result : 処理結果ステータス(OK/NG)
res_err_code : エラーコード |
エラーコード
|
0000:POSTデータ取得失敗
0001:利用API名間違い 0002:認証期限切れ 1301:Base64デコードに失敗 1302:同名URLが登録されている 1303:契約情報取得失敗 1304:URL数上限に達している 1305:URLの登録に失敗 1306:配信認証登録に失敗 1307:許可されない文字が含まれる 9998:メンテナンス中。しばらくたってから再実行して下さい。 |
備考
|
登録するURLはBASE64エンコードしてください。
|
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="base64v1_0.js"></script> <script type="text/javascript"> encode_url = function(name) { document.getElementsByName(name)[0].value = B64.encode(document.getElementsByName(name)[0].value); } </script> </head> <body> <form action="https://typesquare.com/api/service/" method="post"> <p>method: <input type="text" name="method" value="typesquare.regist.url"></p> <p>api_key: <input type="text" name="api_key"></p> <p>登録url: <input type="text" name="url_text"><input type="button" value="base64 encode" onclick="encode_url('url_text');"></p> <p><input type="submit" name="submit" value="send"></p> </form> </body> </html>
※サンプルで使用している base64v1_0.js は Apache License 2.0 で下記のURLで公開されています。
https://github.com/infowrap/base64/
api_keyと登録urlを入力してください。base64 encode をクリックして登録urlを変換してから send をクリックしてください。
機能
|
TypeSquareを利用するサイト(URL)の解除
|
URL
|
https://typesquare.com/api/service
|
引数(POST)
|
method : typesquare.delete.url
api_key : APIキー url_text : 解除URL |
戻り値(XML)
|
res_result : 処理結果ステータス(OK/NG)
res_err_code : エラーコード |
エラーコード
|
0000:POSTデータ取得失敗
0001:利用API名間違い 0002:認証期限切れ 1401:Base64エンコードに失敗 1402:URLが見つからない 1403:URL削除に失敗 1404:配信認証の削除に失敗 9998:メンテナンス中。しばらくたってから再実行して下さい。 |
備考
|
解除するURLはBASE64エンコードしてください。
|
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="base64v1_0.js"></script> <script type="text/javascript"> encode_url = function(name) { document.getElementsByName(name)[0].value = B64.encode(document.getElementsByName(name)[0].value); } </script> </head> <body> <form action="https://typesquare.com/api/service/" method="post"> <p>method: <input type="text" name="method" value="typesquare.delete.url"></p> <p>api_key: <input type="text" name="api_key"></p> <p>削除url: <input type="text" name="url_text"><input type="button" value="base64 encode" onclick="encode_url('url_text');"></p> <p><input type="submit" name="submit" value="send"></p> </form> </body> </html>
※サンプルで使用している base64v1_0.js は Apache License 2.0 で下記のURLで公開されています。
https://github.com/infowrap/base64/
api_keyと削除urlを入力してください。base64 encode をクリックして削除urlを変換してから send をクリックしてください。
機能
|
登録したURLの取得
|
URL
|
https://typesquare.com/api/service
|
引数(POST)
|
method (必須) : typesquare.get.url
api_key (必須) : APIキー |
戻り値(XML)
|
res_result : 処理結果ステータス(OK/NG)
dtls : 取得結果(下記結果サンプル参照) res_err_code : エラーコード |
エラーコード
|
0000:POSTデータ取得失敗
0001:利用API名間違い 0002:認証期限切れ 1201:登録URL取得失敗 |
備考
|
取得したURLはBASE64エンコードされています。
|
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <form action="https://typesquare.com/api/service/" method="post"> <p>method: <input type="text" name="method" value="typesquare.get.url"></p> <p>api_key: <input type="text" name="api_key"></p> <p><input type="submit" name="submit" value="send"></p> </form> </body> </html>
api_keyを入力してsend をクリックしてください。
機能
|
指定した期間のサイト毎のPV取得
|
URL
|
https://typesquare.com/api/service
|
引数(POST)
|
method (必須) : typesquare.get.pv
api_key (必須) : APIキー url_text (任意) : 登録URL start_date (必須) : 開始日(YYYYMMDD) end_date (必須) : 終了日(YYYYMMDD) |
戻り値(XML)
|
res_result : 処理結果ステータス(OK/NG)
dtls : 取得結果(下記結果サンプル参照) res_err_code : エラーコード |
エラーコード
|
0000:POSTデータ取得失敗
0001:利用API名間違い 0002:認証期限切れ 1501:指定期間チェックに失敗 1502:Base64エンコードに失敗 |
備考
|
登録URLはBASE64エンコードしてください。
取得したURLはBASE64エンコードされています。 |
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="base64v1_0.js"></script> <script type="text/javascript"> encode_url = function(name) { document.getElementsByName(name)[0].value = B64.encode(document.getElementsByName(name)[0].value); } </script> </head> <body> <form action="https://typesquare.com/api/service/" method="post"> <p>method: <input type="text" name="method" value="typesquare.get.pv"></p> <p>api_key: <input type="text" name="api_key"></p> <p>対象url: <input type="text" name="url_text"><input type="button" value="base64 encode" onclick="encode_url('url_text');"></p> <p>開始日: <input type="text" name="start_date" placeholder="YYYYMMDD"></p> <p>終了日: <input type="text" name="end_date" placeholder="YYYYMMDD"></p> <p><input type="submit" name="submit" value="send"></p> </form> </body> </html>
※サンプルで使用している base64v1_0.js は Apache License 2.0 で下記のURLで公開されています。
https://github.com/infowrap/base64/
api_key、対象urlおよび開始日・終了日を入力してください。base64 encode をクリックして対象urlを変換してから send をクリックしてください。
機能
|
指定した条件のフォント一覧を取得
|
URL
|
https://typesquare.com/api/service
|
引数(POST)
|
method (必須) : typesquare.get.font
api_key (必須) : APIキー fontname (任意) : 書体名 例)見出ミンMA1 familyname (任意) : ファミリー名 例)見出ミンMA1 fontmaker (任意) : メーカー名 例)モリサワ familystyle (任意) : 書体分類 例)明朝体/ゴシック体 weight (任意) : 太さ 例)細/中/太/特太 language (任意) : 言語 例)日本語 |
戻り値(XML)
|
res_result : 処理結果ステータス(OK/NG)
dtls : 取得結果(下記結果サンプル参照) res_err_code : エラーコード |
エラーコード
|
0000:POSTデータ取得失敗
0001:利用API名間違い 0002:認証期限切れ 1701:Base64エンコードに失敗(書体名) 1702:Base64エンコードに失敗(ファミリー名) 1703:Base64エンコードに失敗(メーカー名) 1704:Base64エンコードに失敗(書体分類) 1705:Base64エンコードに失敗(太さ) 1706:Base64エンコードに失敗(言語) 1707:フォントが見つからない |
備考
|
書体名から言語まではBASE64エンコードしてください。
条件は任意項目です。指定した場合は完全一致の条件で抽出します。 |
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="base64v1_0.js"></script> <script type="text/javascript"> encode_url = function(name) { document.getElementsByName(name)[0].value = B64.encode(document.getElementsByName(name)[0].value); } encode_all = function() { encode_url('fontname'); encode_url('familyname'); encode_url('fontmaker'); encode_url('familystyle'); encode_url('weight'); encode_url('language'); } </script> </head> <body> <form action="https://typesquare.com/api/service/" method="post"> <p>method: <input type="text" name="method" value="typesquare.get.font"></p> <p>api_key: <input type="text" name="api_key"></p> <p>書体名: <input type="text" name="fontname"></p> <p>ファミリー名: <input type="text" name="familyname"></p> <p>メーカー名: <input type="text" name="fontmaker"></p> <p>書体分類: <input type="text" name="familystyle"></p> <p>太さ: <input type="text" name="weight"></p> <p>言語: <input type="text" name="language"></p> <p><input type="button" value="base64 encode" onclick="encode_all();"></p> <p><input type="submit" name="submit" value="send"></p> </form> </body> </html>
※サンプルで使用している base64v1_0.js は Apache License 2.0 で下記のURLで公開されています。
https://github.com/infowrap/base64/
api_key と任意の絞り込み項目を入力してください。base64 encode をクリックして入力内容を変換してから send をクリックしてください。