GetNetwork

IDtail.com API

Jump to: navigation, 찾기

목차

[편집] QUERY

http://api.idtail.com/get_network/<USERNAME>: (FOAF 형식으로 요청)
http://api.idtail.com/get_network/<USERNAME>.foaf
http://api.idtail.com/get_network/<USERNAME>.json[?options]

[편집] options

json 형식에는 몇가지 유용한 옵션이 존재합니다.

* callback=<function name>

json은 전체가 하나의 array로 된 데이터라고 할 수 있습니다. 이 옵션을 사용하면, 이 데이터가 함수의 인자로 넘어가는 형식으로 결과가 출력됩니다.

* includeviewer=1

현재 접근한 사람이 idtail.com에 로그인한 상태거나 개인 알림정보에 사용되는 인증 방식으로 이 Query를 호출하면, <USERNAME>외에도 접근한 사람의 정보를 출력하게 됩니다.

[편집] RETURN

  • FOAF 형식
<?xml version="1.0" encoding="UTF-8"?><rdf:RDF
       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
       xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
       xmlns:foaf="http://xmlns.com/foaf/0.1/"
       xmlns:admin="http://webns.net/mvcb/">
<foaf:PersonalProfileDocument rdf:about="">
       <foaf:maker rdf:resource="#아이디테일 ID"/>
       <foaf:primaryTopic rdf:resource="#아이디테일 ID"/>
       <admin:generatorAgent rdf:resource="http://www.idtail.com/"/>
</foaf:PersonalProfileDocument>
<foaf:Person rdf:ID="아이디테일 ID">
       <foaf:name>이름</foaf:name>
       <foaf:openid>아이디테일에서 발급한 OpenID</foaf:openid>
       <foaf:nick>닉네임</foaf:nick>
       <foaf:gender>male 또는 female</foaf:gender>
       <foaf:locality>첫번째 지역명</foaf:locality>
       <foaf:locality>두번째 지역명</foaf:locality>
       <foaf:locality>세번째 지역명</foaf:locality>
       <foaf:interest>
               <rdf:Description rdfs:label="관심분야 1"/>
               <rdf:Description rdfs:label="관심분야 2"/>
               <rdf:Description rdfs:label="관심분야 3"/>
               <rdf:Description rdfs:label="관심분야 4"/>
       </foaf:interest>
       <foaf:workplaceHomepage rdf:resource="홈페이지"/>
       <foaf:mbox_sha1sum>인증된 이메일의 해시값</foaf:mbox_sha1sum>
       <foaf:weblog rdf:resource="홈페이지"/>
       <foaf:homepage rdf:resource="홈페이지"/>
       <foaf:depiction rdf:resource="100x100 이미지" />
       <foaf:img rdf:resource="100x100 이미지" />
       <foaf:knows>  <foaf:knows> 는 <foaf:Person> 하나만을 갖습니다.
               <foaf:Person rdf:ID="친구의 아이디테일 ID" >
                       <foaf:name>친구의 이름</foaf:name>
                       <foaf:openid>아이디테일에서 발급한 친구의 OpenID</foaf:openid>
                       <foaf:nick>친구의 닉네임</foaf:nick>
                       <foaf:mbox_sha1sum>인증된 이메일의 해시값</foaf:mbox_sha1sum>
                       <foaf:homepage rdf:resource="친구의 홈페이지" />
                       <foaf:weblog rdf:resource="친구의 홈페이지" />
                       <foaf:depiction rdf:resource="100x100 이미지" />
                       <foaf:img rdf:resource="100x100 이미지" />
                       <foaf:gender>male 또는 female</foaf:gender>
                       <foaf:locality>첫번째 지역명</foaf:locality>
                       <foaf:locality>두번째 지역명</foaf:locality>
                       <foaf:locality>세번째 지역명</foaf:locality>
                       <foaf:interest>
                               <rdf:Description rdfs:label="관심분야 1"/>
                               <rdf:Description rdfs:label="관심분야 2"/>
                               <rdf:Description rdfs:label="관심분야 3"/>
                               <rdf:Description rdfs:label="관심분야 4"/>
                       </foaf:interest>
                       <rdfs:seeAlso rdf:resource="사용자의 FOAF URL" />
               </foaf:Person>
       </foaf:knows>
       <foaf:knows>
               <foaf:Person rdf:ID="친구의 아이디테일 ID" >
                       <foaf:name>친구의 이름</foaf:name>
                       <foaf:openid>아이디테일에서 발급한 친구의 OpenID</foaf:openid>
                       <foaf:nick>친구의 닉네임</foaf:nick>
                       <foaf:mbox_sha1sum>인증된 이메일의 해시값</foaf:mbox_sha1sum>
                       <foaf:homepage rdf:resource="친구의 홈페이지" />
                       <foaf:weblog rdf:resource="친구의 홈페이지" />
                       <foaf:depiction rdf:resource="100x100 이미지" />
                       <foaf:img rdf:resource="100x100 이미지" />
                       <foaf:gender>male 또는 female</foaf:gender>
                       <foaf:locality>첫번째 지역명</foaf:locality>
                       <foaf:locality>두번째 지역명</foaf:locality>
                       <foaf:locality>세번째 지역명</foaf:locality>
                       <foaf:interest>
                               <rdf:Description rdfs:label="관심분야 1"/>
                               <rdf:Description rdfs:label="관심분야 2"/>
                               <rdf:Description rdfs:label="관심분야 3"/>
                               <rdf:Description rdfs:label="관심분야 4"/>
                       </foaf:interest>
                       <rdfs:seeAlso rdf:resource="사용자의 FOAF URL" />
               </foaf:Person>
       </foaf:knows>
       ....
</foaf:Person>
</rdf:RDF>
  • JSON 형식
{
    "owner":{
        "fields":{
            "id" : "아이디테일 ID",
            "name":" 이름 ",
            "nick":" 닉네임 ",
            "openid": " 아이디테일에서 발급한 오픈아이디 ",
            "img" : " 100x100 아이콘 ",
            "gender" : " male 또는 female ",
            "mbox_sha1sum" : " foaf:mbox_sha1sum 값과 같은 메일주소 해시값 ", 
            "workplaceHomepage" : " 공개된 재직중인 회사의 홈페이지 ",
            "weblog" : " 홈페이지 ",
            "homepage" : " 홈페이지 ",
            "locality" : [
                "첫번째 지역명",
                "두번째 지역명",
                "세번째 지역명"
            ],
            "interest" : [
                {     
                    "label" : "관심분야 1"
                },
                {     
                    "label" : "관심분야 2"
                }
                ...
            ]
        }
    },
    "ownerFriends":[
	{
		"fields":{
			"id" : "themaum",
			"name":"김성호",
			"nick":"더마음",
               ...
	},
	{
		"fields":{
			"id" : "pebblebeach",
			"name":"송교석",
			"nick":"페블이",
               ...
	},
    ]
}

[편집] SAMPLES

  • FOAF 형식
<?xml version="1.0" encoding="UTF-8"?><rdf:RDF
       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
       xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
       xmlns:foaf="http://xmlns.com/foaf/0.1/"
       xmlns:admin="http://webns.net/mvcb/">
<foaf:PersonalProfileDocument rdf:about="">
       <foaf:maker rdf:resource="#coolengineer"/>
       <foaf:primaryTopic rdf:resource="#coolengineer"/>
       <admin:generatorAgent rdf:resource="http://www.idtail.com/"/>
</foaf:PersonalProfileDocument>
<foaf:Person rdf:ID="coolengineer">
       <foaf:name>최호진</foaf:name>
       <foaf:openid>http://coolengineer.idtail.com/</foaf:openid>
       <foaf:nick>coolengineer</foaf:nick>
       <foaf:gender>male</foaf:gender>
       <foaf:locality>서울특별시/영등포구/여의도동/</foaf:locality>
       <foaf:locality>서울특별시/송파구/풍납동/</foaf:locality>
       <foaf:interest>
               <rdf:Description rdfs:label="리눅스"/>
               <rdf:Description rdfs:label="웹2.0"/>
       </foaf:interest>
       <foaf:workplaceHomepage rdf:resource="http://www.ahnlab.com/"/>
       <foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum>
       <foaf:weblog rdf:resource="http://coolengineer.com/"/>
       <foaf:homepage rdf:resource="http://coolengineer.com/"/>
       <foaf:depiction rdf:resource="http://coolengineer.idtail.com/icon/100x100.jpg" />
       <foaf:img rdf:resource="http://coolengineer.idtail.com/icon/100x100.jpg" />
       <foaf:knows>
               <foaf:Person rdf:ID="themaum" >
               <foaf:name>김성호</foaf:name>
               <foaf:openid>http://themaum.idtail.com/</foaf:openid>
               <foaf:nick>themaum</foaf:nick>
               <foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum>
               <foaf:homepage rdf:resource="http://themaum.com" />
               <foaf:weblog rdf:resource="http://themaum.com" />
               <foaf:depiction rdf:resource="http://themaum.idtail.com/icon/100x100.jpg" />
               <foaf:img rdf:resource="http://themaum.idtail.com/icon/100x100.jpg" />
               <foaf:gender>male</foaf:gender>
               <foaf:locality>서울특별시/여의도</foaf:locality>
               <foaf:locality>서울특별시/마포구 홍대근처</foaf:locality>
               <foaf:locality>서울특별시/노원구</foaf:locality>
               <foaf:interest>
               <rdf:Description rdfs:label="web"/>
               <rdf:Description rdfs:label="design"/>
               </foaf:interest>
               <rdfs:seeAlso rdf:resource="http://themaum.idtail.com/foaf" />
               </foaf:Person>
       </foaf:knows>
       <foaf:knows>
               <foaf:Person rdf:ID="pebblebeach" >
               <foaf:name>송교석</foaf:name>
               <foaf:openid>http://pebblebeach.idtail.com/</foaf:openid>
               <foaf:nick>pebblebeach</foaf:nick>
               <foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum>
               <foaf:homepage rdf:resource="http://pebblebeach.tistory.com" />
               <foaf:weblog rdf:resource="http://pebblebeach.tistory.com" />
               <foaf:depiction rdf:resource="http://pebblebeach.idtail.com/icon/100x100.jpg" />
               <foaf:img rdf:resource="http://pebblebeach.idtail.com/icon/100x100.jpg" />
               <foaf:gender>male</foaf:gender>
               <foaf:locality>서울특별시/영등포구/여의도동/</foaf:locality>
               <foaf:locality>서울특별시/강남구/압구정동/</foaf:locality>
               <foaf:locality>서울특별시/강남구/삼성동/</foaf:locality>
               <foaf:interest>
               <rdf:Description rdfs:label="뮤지컬"/>
               <rdf:Description rdfs:label="웹2.0"/>
               </foaf:interest>
               <foaf:workplaceHomepage rdf:resource="http://www.wellsfargo.com"/>
               <rdfs:seeAlso rdf:resource="http://pebblebeach.idtail.com/foaf" />
               </foaf:Person>
       </foaf:knows>
</foaf:Person>
</rdf:RDF>
  • JSON 형식
{
    "owner":{
        "fields":{
            "id" : "http://coolengineer.idtail.com/",
            "name":"최호진",
            "nick":"coolengineer",
            "openid":"http://coolengineer.idtail.com/",
            "img" : "http://coolengineer.idtail.com/icon/100x100.jpg",
            "gender" : "male",
            "mbox_sha1sum" : "da39a3ee5e6b4b0d3255bfef95601890afd80709", 
            "workplaceHomepage" :"http://www.ahnlab.com/",
            "weblog" : "http://coolengineer.com/",
            "homepage" : "http://coolengineer.com/",
            "locality" : [
                "서울특별시/영등포구/여의도동/",
                "서울특별시/송파구/풍납동/",
                "서울특별시/송파구/풍납동/"
            ],
            "interest" : [
            {     
                "label" : "리눅스"
            },
            {     
                "label" : "웹2.0"
            }]
        }
    }
}

[편집] ERROR