{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/:id","auth":"required","examples":{"codes":[{"code":"# Exemplo em Ruby\n\nrequire 'digest/sha1'\nrequire 'httparty'\nrequire 'json'\n\nsignature = Digest::SHA1.hexdigest('SUA_SECRET_KEY')\nid = 'ID_DO_SEU_USUARIO'\n\nparams = {\n  id_type: 'id',\n  platform_api_key: 'SUA_API_KEY', \n  sha1_signature: signature,\n  encoding: 'base64',\n  network_name: 'pt'\n}\n\nHTTParty.get(\"https://login.plataformasocial.com.br/users/#{id}\", body: params)\n","language":"ruby","name":""},{"code":"import java.io.BufferedReader;\nimport java.io.BufferedWriter;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.OutputStream;\nimport java.io.OutputStreamWriter;\nimport java.io.UnsupportedEncodingException;\nimport java.net.HttpURLConnection;\nimport java.net.URL;\nimport java.net.URLEncoder;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\nimport java.util.Map.Entry;\n\nimport javax.net.ssl.HttpsURLConnection;\n\nimport org.json.JSONObject;\n\npublic class DitoBuscarUsuario {\n\n\tpublic static void main(String[] args) throws Exception {\n\t\t\n\t\tString id = \"ID_DO_SEU_USUARIO\";\n\t\tString url = \"https://login.plataformasocial.com.br/users/\" + id;\n\n\t\tString platform_api_key = \"SUA_API_KEY\";\n\t\tString secret_key = \"SUA_SECRET_KEY\";\n\t\t\n\t\tString signature = sha1(secret_key);\n\t\t\n\t\tHashMap<String, String> params = new HashMap<String, String>();\n\t\tparams.put(\"id_type\", \"id\");\n\t\tparams.put(\"platform_api_key\", platform_api_key);\n\t\tparams.put(\"sha1_signature\", signature);\n\t\tparams.put(\"network_name\", \"pt\");\n\t\t\n\t\tJSONObject response = doGet(url, params);\n\t\tSystem.out.println(response.toString());\n\t}\n\n  static String sha1(String input) throws NoSuchAlgorithmException {\n    MessageDigest mDigest = MessageDigest.getInstance(\"SHA1\");\n    byte[] result = mDigest.digest(input.getBytes());\n    StringBuffer sb = new StringBuffer();\n    for (int i = 0; i < result.length; i++) {\n      sb.append(Integer.toString((result[i] & 0xff) + 0x100, 16).substring(1));\n    }\n         \n    return sb.toString();\n  }\n  \n\tprivate static JSONObject doGet(String url, HashMap<String, String> params) throws IOException {\n\t\t\n    URL obj = new URL(url + \"?\" + getQuery(params));\n\t\tHttpsURLConnection conn = (HttpsURLConnection) obj.openConnection();\n\t\tconn.setRequestMethod(\"GET\");\n\t\tconn.setRequestProperty(\"Content-Type\", \"application/json\");\n\t\t\n\t\tif (conn.getResponseCode() == HttpURLConnection.HTTP_OK) {\n\t\t\tBufferedReader in = new BufferedReader(\n\t\t\t        new InputStreamReader(conn.getInputStream()));\n\t\t\tString inputLine;\n\t\t\tStringBuffer response = new StringBuffer();\n\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\tresponse.append(inputLine);\n\t\t\t}\n\t\t\tin.close();\n      \n      conn.disconnect();\n\t\t\t\n\t\t\tJSONObject jsonObj = new JSONObject(response.toString());\n\t\t\treturn jsonObj;\n\t\t}\n    \n    conn.disconnect();\n\t\t\n\t\treturn null;\n\t}\n  \n\tprivate static String getQuery(HashMap<String, String> params) throws UnsupportedEncodingException\n\t{\n\t    StringBuilder result = new StringBuilder();\n\t    boolean first = true;\n\n\t    for (Entry<String, String> entry : params.entrySet())\n\t    {\n\t        if (first)\n\t            first = false;\n\t        else\n\t            result.append(\"&\");\n\n\t        result.append(URLEncoder.encode(entry.getKey(), \"UTF-8\"));\n\t        result.append(\"=\");\n\t        result.append(URLEncoder.encode(entry.getValue(), \"UTF-8\"));\n\t    }\n\n\t    return result.toString();\n\t}\n  \n}","language":"java"}]},"method":"get","params":[{"name":"id","type":"string","default":"","desc":"Identificador do usuário na Dito. Ex.: CPF do usuário (somente números), SHA1 do e-mail, ID do banco de dados.","required":true,"in":"path","ref":"","_id":"55afc464b3171b3700b1505d"},{"name":"id_type","type":"string","default":"","desc":"Deve ser uma string com valor \"id\"","required":false,"in":"query","ref":"","_id":"55afc464b3171b3700b1505e"},{"name":"signature","type":"string","default":"","desc":"Assinatura (RSA com SECRET_KEY)","required":false,"in":"query","ref":"","_id":"55afc464b3171b3700b15062"},{"name":"sha1_signature","type":"string","default":"","desc":"Assinatura (SHA1 com SECRET_KEY)","required":false,"in":"query","ref":"","_id":"55b136d2b2405537003cd9e8"},{"name":"platform_api_key","type":"string","default":"","desc":"API KEY","required":true,"in":"query","ref":"","_id":"55afc464b3171b3700b15061"},{"name":"network_name","type":"string","default":"","desc":"Deve ser uma string com valor \"pt\"","required":true,"in":"query","ref":"","_id":"55afc464b3171b3700b1505f"},{"name":"encoding","type":"string","default":"","desc":"Codificação utilizada. Ex.: base64","required":false,"in":"query","ref":"","_id":"55afc464b3171b3700b15060"}],"results":{"codes":[]},"settings":"55afbd32d7624e3700e4f9f2"},"next":{"description":"","pages":[]},"title":"Buscar usuário","type":"endpoint","slug":"busca-do-usuário","excerpt":"","body":"Busca usuário na API.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Parâmetros da URL\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parâmetro\",\n    \"h-1\": \"Obrigatório\",\n    \"h-2\": \"Tipo\",\n    \"h-3\": \"Descrição\",\n    \"0-0\": \"id\",\n    \"0-1\": \"Sim\",\n    \"0-2\": \"String\",\n    \"0-3\": \"Identificador do usuário na Dito. Ex.: CPF do usuário (somente números), SHA1 do e-mail, ID do banco de dados.\"\n  },\n  \"cols\": 4,\n  \"rows\": 1\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Parâmetros da requisição\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"1-0\": \"signature\",\n    \"2-0\": \"sha1_signature\",\n    \"3-0\": \"platform_api_key\",\n    \"4-0\": \"network_name\",\n    \"4-1\": \"Sim\",\n    \"4-2\": \"String\",\n    \"4-3\": \"Deve ser uma string com valor \\\"pt\\\"\",\n    \"4-4\": \"\",\n    \"h-4\": \"\",\n    \"h-3\": \"Descrição\",\n    \"h-2\": \"Tipo\",\n    \"h-1\": \"Obrigatório\",\n    \"h-0\": \"Parâmetro\",\n    \"1-1\": \"Sim (Exceto se utilizar o sha1_signature)\",\n    \"2-1\": \"Sim (Exceto se utilizar o signature)\",\n    \"3-1\": \"Sim\",\n    \"1-2\": \"String\",\n    \"2-2\": \"String\",\n    \"3-2\": \"String\",\n    \"0-0\": \"id_type\",\n    \"0-1\": \"Não\",\n    \"0-2\": \"String\",\n    \"0-3\": \"Deve ser uma string com o valor \\\"id\\\"\",\n    \"0-4\": \"\",\n    \"1-4\": \"\",\n    \"1-3\": \"Assinatura gerada via RSA com a chave SECRET_KEY.\",\n    \"2-3\": \"Assinatura gerada via SHA1 com a chave SECRET_KEY.\",\n    \"2-4\": \"\",\n    \"3-4\": \"\",\n    \"3-3\": \"API_KEY do aplicativo.\",\n    \"5-0\": \"encoding\",\n    \"5-1\": \"Não\",\n    \"5-2\": \"String\",\n    \"5-3\": \"Codificação utilizada para a assinatura (base64 ou nenhuma codificação se não informado).\",\n    \"5-4\": \"\"\n  },\n  \"cols\": 4,\n  \"rows\": 6\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Exemplo de Retorno\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"  {\\n    \\\"data\\\": {\\n      \\\"removed_permissions\\\": [],\\n      \\\"reference\\\": \\\"123456789\\\",\\n      \\\"networks\\\": {\\n        \\\"portal\\\": {\\n          \\\"social_id\\\": \\\"123456\\\",\\n          \\\"gender\\\": \\\"male\\\",\\n          \\\"name\\\": \\\"Marcos Nogueira\\\",\\n          \\\"email\\\": \\\"marcos:::at:::example.com\\\",\\n          \\\"age\\\": 24,\\n          \\\"location\\\": \\\"Belo Horizonte\\\"\\n        }\\n      },\\n      \\\"data\\\": {}\\n    }\\n  }\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","updates":[],"order":2,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"55afbd9ad7624e3700e4f9f5","githubsync":"","createdAt":"2015-07-22T15:58:18.600Z","category":{"sync":{"isSync":false,"url":""},"pages":["554a57af58f5650d00ae43d6","55a98a0602becf2d007aad8f","55a98bf45d3abb0d0012f2e7","55afbd9ad7624e3700e4f9f5","55afbdd2b3171b3700b1501e","55b29ab31550ae0d003d98a8","55b29b0d1550ae0d003d98aa","55b29bb91550ae0d003d98ad","55b29bdea74a380d00e29046","55b2a7efa74a380d00e29065","55b2a91ca74a380d00e29069"],"title":"APIs","slug":"apis","order":3,"from_sync":false,"reference":false,"_id":"554a574f0b54d30d007fe0f9","__v":11,"createdAt":"2015-05-06T18:02:55.085Z","project":"5538fb24dc5dd00d00e1da91","version":"5538fb25dc5dd00d00e1da94"},"editedParams":true,"user":"556f85e29893290d00988dc5","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5538fb25dc5dd00d00e1da95","5538feec27f8540d0024f00e","5547cbd3d3427d0d00cd6e2d","554a574f0b54d30d007fe0f9","55afbdbef202b12100cd9eeb","5c016f198e69b802d4385e25","5c81470b175ad6002457d9fa","5c81472e74fd5a0063420bae","5c81476b2dd69100430ea5a4"],"_id":"5538fb25dc5dd00d00e1da94","createdAt":"2015-04-23T14:01:09.040Z","project":"5538fb24dc5dd00d00e1da91","__v":9,"releaseDate":"2015-04-23T14:01:09.040Z"},"editedParams2":true,"__v":11,"project":"5538fb24dc5dd00d00e1da91","parentDoc":null}

getBuscar usuário


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

id:
required
string
Identificador do usuário na Dito. Ex.: CPF do usuário (somente números), SHA1 do e-mail, ID do banco de dados.

Query Params

id_type:
string
Deve ser uma string com valor "id"
signature:
string
Assinatura (RSA com SECRET_KEY)
sha1_signature:
string
Assinatura (SHA1 com SECRET_KEY)
platform_api_key:
required
string
API KEY
network_name:
required
string
Deve ser uma string com valor "pt"
encoding:
string
Codificação utilizada. Ex.: base64

Examples


Documentation

Busca usuário na API. [block:api-header] { "type": "basic", "title": "Parâmetros da URL" } [/block] [block:parameters] { "data": { "h-0": "Parâmetro", "h-1": "Obrigatório", "h-2": "Tipo", "h-3": "Descrição", "0-0": "id", "0-1": "Sim", "0-2": "String", "0-3": "Identificador do usuário na Dito. Ex.: CPF do usuário (somente números), SHA1 do e-mail, ID do banco de dados." }, "cols": 4, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Parâmetros da requisição" } [/block] [block:parameters] { "data": { "1-0": "signature", "2-0": "sha1_signature", "3-0": "platform_api_key", "4-0": "network_name", "4-1": "Sim", "4-2": "String", "4-3": "Deve ser uma string com valor \"pt\"", "4-4": "", "h-4": "", "h-3": "Descrição", "h-2": "Tipo", "h-1": "Obrigatório", "h-0": "Parâmetro", "1-1": "Sim (Exceto se utilizar o sha1_signature)", "2-1": "Sim (Exceto se utilizar o signature)", "3-1": "Sim", "1-2": "String", "2-2": "String", "3-2": "String", "0-0": "id_type", "0-1": "Não", "0-2": "String", "0-3": "Deve ser uma string com o valor \"id\"", "0-4": "", "1-4": "", "1-3": "Assinatura gerada via RSA com a chave SECRET_KEY.", "2-3": "Assinatura gerada via SHA1 com a chave SECRET_KEY.", "2-4": "", "3-4": "", "3-3": "API_KEY do aplicativo.", "5-0": "encoding", "5-1": "Não", "5-2": "String", "5-3": "Codificação utilizada para a assinatura (base64 ou nenhuma codificação se não informado).", "5-4": "" }, "cols": 4, "rows": 6 } [/block] [block:api-header] { "type": "basic", "title": "Exemplo de Retorno" } [/block] [block:code] { "codes": [ { "code": " {\n \"data\": {\n \"removed_permissions\": [],\n \"reference\": \"123456789\",\n \"networks\": {\n \"portal\": {\n \"social_id\": \"123456\",\n \"gender\": \"male\",\n \"name\": \"Marcos Nogueira\",\n \"email\": \"[email protected]\",\n \"age\": 24,\n \"location\": \"Belo Horizonte\"\n }\n },\n \"data\": {}\n }\n }", "language": "json" } ] } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}