Socialid.selfie.unlike

From Social ID Developers
(Difference between revisions)
Jump to: navigation, search
(Created page with "== Description == Remove um like de post de um determinado usuário. == Usage == socialid.selfie.unlike(postId, handler, options) == Parameters == {| ! align="left" wid...")
 
 
Line 1: Line 1:
 
== Description ==
 
== Description ==
  
Remove um like de post de um determinado usuário.
+
Removes a like in a post from a particular user (decrements the likes count).
  
 
== Usage ==
 
== Usage ==
Line 11: Line 11:
 
{|
 
{|
 
! align="left" width="200px" | postId
 
! align="left" width="200px" | postId
| width="200px" | obrigatório
+
| width="200px" | required
| Identificador numérico do post.
+
| numeric identifier for the post.
 
|+
 
|+
 
! align="left" width="200px" | handler
 
! align="left" width="200px" | handler
| width="200px" | opcional
+
| width="200px" | optional
| Especifica uma função de callback para tratar a resposta da API.
+
| callback function to be called on the API response.
 
|+
 
|+
 
! align="left" width="200px" | options
 
! align="left" width="200px" | options
| width="200px" | opcional
+
| width="200px" | optional
| um objeto contendo parâmetros adicionais
+
| object containing additional parameters.
 
|+
 
|+
 
! align="left" width="200px" style="padding-left: 20px" | user_id
 
! align="left" width="200px" style="padding-left: 20px" | user_id
| width="200px" | opcional
+
| width="200px" | optional
| Identificador do usuário. Default: IP do usuário.
+
| user identifier. Default: User IP.
 
|}
 
|}
  
Line 31: Line 31:
 
{|
 
{|
 
! align="left" width="200px" | data
 
! align="left" width="200px" | data
| Sempre "null". Esta API não retorna dados.
+
| Always "null". This API doesn't return any data.
 
|+
 
|+
 
! align="left" width="200px" | status
 
! align="left" width="200px" | status
| O status da execução da chamada da API. Pode ser '''"success"''', se o like foi removido com sucesso,  '''"not_found"''', caso o post não tenha sido encontrado ou o usuário não tenha realizado like anteriormente, ou '''"internal_server_error"''', caso algum erro desconhecido aconteça.
+
| API call status. Can be '''"success"''' in case of a successful unlike, '''"not_found"''' in case the post wasn't found, or '''"internal_server_error"''' in case an unknown error occurs.
 
|}
 
|}
  
 
== Example ==
 
== Example ==
  
Remove o like do usuário identificado pelo user_id "32" para o post "34":
+
Makes the user with user_id = "32" unlike the post with post_id = "34":
  
 
   var handler = function(response) {
 
   var handler = function(response) {
 
     if (response.status == "success") {
 
     if (response.status == "success") {
         alert("Unlike realizado com sucesso.");
+
         alert("Unlike successful.");
 
     } else {
 
     } else {
         alert("Não foi possível realizar o unlike.");
+
         alert("Wasn't possible to unlike this post.");
 
     }
 
     }
 
   }
 
   }

Latest revision as of 11:45, 4 November 2014

Contents

Description

Removes a like in a post from a particular user (decrements the likes count).

Usage

 socialid.selfie.unlike(postId, handler, options)

Parameters

postId required numeric identifier for the post.
handler optional callback function to be called on the API response.
options optional object containing additional parameters.
user_id optional user identifier. Default: User IP.

API Response

data Always "null". This API doesn't return any data.
status API call status. Can be "success" in case of a successful unlike, "not_found" in case the post wasn't found, or "internal_server_error" in case an unknown error occurs.

Example

Makes the user with user_id = "32" unlike the post with post_id = "34":

 var handler = function(response) {
    if (response.status == "success") {
       alert("Unlike successful.");
    } else {
       alert("Wasn't possible to unlike this post.");
    }
 }
 var appId = 1;
 socialid.selfie.init(appId);
 socialid.selfie.unlike(34, handler, {user_id: 32});
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox