Feedback

Playground API

Table of Contents


authentication

URL: http://www.pg.in.th/oapi/auth

Description: login เพื่อเข้าใช้งาน method อื่นของ API

Format: json

Method: GET, POST

Parameters:

  • username : username ที่ใช้ในการ login เข้าเว็บ
  • password : password ที่ใช้ในการ login เข้าเว็บ
  • ApplicationKey : คีย์ที่ใช้ในการเข้าถึง api ต่างๆ

Response Example: {"StatusCode" : "200", AuthenticationKey : "Adm5FgZ432DhXudZi4FSzi", UserId : 10}

Status Codes:

  • 200 : success
  • 111 : parameters ไม่ึครบ
  • 100 : ไม่มี user นี้
  • 101 : password ไม่ถูกต้อง

friends

URL: http://www.pg.in.th/oapi/friends/{id ของ user}

Description: list ข้อมูลเพื่อนของ user ที่ระบุ

Format: json

Method: GET, POST

Parameters: N/A

Response Example: {"StatusCode" : "200", "Friends": [{"DisplayName": "arttuxx", "id": 18, "avatar": "/asset/avatar/30x30/default.png"}, {"DisplayName": "เบน", "id": 20, "avatar": "/asset/avatar/30x30/default.png"}]}

Status Codes:

  • 200 : success
  • 100 : ไม่มี user นี้

status (read)

URL: http://www.pg.in.th/oapi/status/read/{id ของ user}

Description: อ่าน status ล่าสุดของ user ที่ระบุ

Format: json

Method: GET, POST

Parameters: N/A

Response Example: {"StatusCode" : "200", "StatusText": "Hello World"}

Status Codes:

  • 200 : success
  • 100 : ไม่มี user นี้

status (add)

URL: http://www.pg.in.th/oapi/status/add/{UserId ที่ได้รับจาก method Authentication}

Description: เพิ่ม status ให้กับ user ที่ทำ authentication

Format: json

Method: GET, POST

Parameters:

  • AuthenticationKey: คีย์ที่ได้รับจาก method Authentication
  • ApplicationKey: คีย์ที่ใช้ในการเข้าถึง api ต่างๆ
  • Text: ข้อความ status

Response Example: {"StatusCode" : "200", "StatusText": "Hello World"}

Status Codes:

  • 200 : success
  • 111 : parameters ไม่ึครบ
  • 100 : ไม่มี user นี้
  • 401 : ไม่มีสิทธิในการเพิ่ม status ให้กับ UserId นี้

latest

URL: http://www.pg.in.th/oapi/latest/{จำนวนข้อมูลที่เอามาแสดง (optional)}

Description: list รายละเอียดของรูปหรือวิดีโอที่ถูกอัพโหลดมาล่าสุด

Format: json

Method: GET, POST

Parameters: N/A

Response Example: {"StatusCode": "200", "Items": [{"Src": "/photo/square/39704", "UploadTime": "05.11.2008 11:18", "MediaId": 39704, "Description": "", "Tags": "", "Title": ".", "UserId": "10095", "Place": "", "Type": "Photo"}, {"Src": "/photo/square/39703", "UploadTime": "05.11.2008 11:16", "MediaId": 39703, "Description": "", "Tags": "", "Title": ".", "UserId": "10095", "Place": "", "Type": "Photo"}, {"Src": "/photo/square/39702", "UploadTime": "05.11.2008 11:14", "MediaId": 39702, "Description": "", "Tags": "", "Title": "", "UserId": "69", "Place": "สุขุมวิท 1", "Type": "Photo"}]}

Status Codes:

  • 200 : success

latest (tag)

URL: http://www.pg.in.th/oapi/latest/{จำนวนข้อมูลที่เอามาแสดง (optional)}

Description: list รายละเอียดของรูปหรือวิดีโอที่ถูกอัพโหลดมาล่าสุดและเกี่ยวข้องกับ tag ที่ต้องการค้นหา

Format: json

Method: GET, POST

Parameters: tag=tag ที่ถูก escape ตัวอักษร HTML แล้ว

Response Example: {"StatusCode": "200", "Items": [{"Src": "/photo/square/39704", "UploadTime": "05.11.2008 11:18", "MediaId": 39704, "Description": "", "Tags": "Sushi", "Title": ".", "UserId": "10095", "Place": "", "Type": "Photo"}, {"Src": "/photo/square/39703", "UploadTime": "05.11.2008 11:16", "MediaId": 39703, "Description": "", "Tags": "Sushi", "Title": ".", "UserId": "10095", "Place": "", "Type": "Photo"}, {"Src": "/photo/square/39702", "UploadTime": "05.11.2008 11:14", "MediaId": 39702, "Description": "", "Tags": "Sushi", "Title": "", "UserId": "69", "Place": "สุขุมวิท 1", "Type": "Photo"}]}

Status Codes:

  • 200 : success
  • 404 : ไม่พบ tag ที่ต้องการค้นหา

photos

URL: http://www.pg.in.th/oapi/photos/{id ของ user}/{จำนวนข้อมูลที่เอามาแสดง (optional)}

Description: list รายละเอียดของรูปล่าสุดของ user ที่ะบุ

Format: json

Method: GET, POST

Parameters: N/A

Response Example: {"StatusCode": "200", "Photos": [{"Src": "/photo/square/39601", "UploadTime": "04.11.2008 23:24", "PhotoId": 39601, "Description": "", "Tags": "", "Title": "Android tmobile g1", "Longitude": "100.51", "Place": "หมู่บ้านปากเกร็ด", "Latitude": "13.91"}, {"Src": "/photo/square/39599", "UploadTime": "04.11.2008 23:21", "PhotoId": 39599, "Description": "", "Tags": "", "Title": "Android tmobile g1", "Longitude": "100.51", "Place": "หมู่บ้านปากเกร็ด", "Latitude": "13.91"}, {"Src": "/photo/square/39597", "UploadTime": "04.11.2008 23:19", "PhotoId": 39597, "Description": "", "Tags": "", "Title": "Android tmobile g1", "Longitude": "100.51", "Place": "หมู่บ้านปากเกร็ด", "Latitude": "13.91"}]}

Status Codes:

  • 200 : success
  • 100 : ไม่มี user นี้

photos (tag)

URL: http://www.pg.in.th/oapi/photos/{id ของ user}/{จำนวนข้อมูลที่เอามาแสดง (optional)}

Description: list รายละเอียดของรูปล่าสุดของ user ซึ่งเกี่ยวข้องกับ tag ที่ระบุ

Format: json

Method: GET, POST

Parameters: tag=tag ที่ถูก escape ตัวอักษร HTML แล้ว

Response Example: {"StatusCode": "200", "Photos": [{"Src": "/photo/square/39601", "UploadTime": "04.11.2008 23:24", "PhotoId": 39601, "Description": "", "Tags": "Sushi", "Title": "Android tmobile g1", "Longitude": "100.51", "Place": "หมู่บ้านปากเกร็ด", "Latitude": "13.91"}, {"Src": "/photo/square/39599", "UploadTime": "04.11.2008 23:21", "PhotoId": 39599, "Description": "", "Tags": "Sushi", "Title": "Android tmobile g1", "Longitude": "100.51", "Place": "หมู่บ้านปากเกร็ด", "Latitude": "13.91"}, {"Src": "/photo/square/39597", "UploadTime": "04.11.2008 23:19", "PhotoId": 39597, "Description": "", "Tags": "Sushi", "Title": "Android tmobile g1", "Longitude": "100.51", "Place": "หมู่บ้านปากเกร็ด", "Latitude": "13.91"}]}

Status Codes:

  • 200 : success
  • 100 : ไม่มี user นี้
  • 404 : ไม่พบ tag ที่ต้องการค้นหา หรือ user ไม่เคยใช้ tag ดังกล่าว

location (read)

URL: http://www.pg.in.th/oapi/location/read/{id ของ user}

Description: หาตำแหน่งสุดท้ายของ user ที่ระบุ

Format: json

Method: GET, POST

Parameters: N/A

Response Example: {"StatusCode": "200", "Location": {"Latitude": "13.91", "Longitude": "100.51"}, "Time": "02.11.2008 21:41"}

Status Codes:

  • 200 : success
  • 100 : ไม่มี user นี้

location (add)

URL: http://www.pg.in.th/oapi/location/add/{UserId ที่ได้รับจาก method Authentication}

Description: เพิ่มตำแหน่งสุดท้ายของ user ที่ระบุ

Format: json

Method: GET, POST

Parameters:

  • AuthenticationKey: คีย์ที่ได้รับจาก method Authentication
  • ApplicationKey: คีย์ที่ใช้ในการเข้าถึง api ต่างๆ
  • Latitude
  • Longitude

Response Example: {"StatusCode": "200", "Location": {"Latitude": "13.915799442923", "Longitude": "100.511274816549"}, "Time": "02.11.2008 21:41"}

Status Codes:

  • 200 : success
  • 111 : parameters ไม่ึครบ
  • 100 : ไม่มี user นี้
  • 401 : ไม่มีสิทธิในการเพิ่มตำแหน่งให้กับ UserId นี้