Mudanças entre as edições de "TokenGenService.svc"

De LATROMI Manuais
Ir para: navegação, pesquisa
(Criou página com '* Endereço: https://tokengen.latromi.com.br/TokenGenService.svc/rest/generateAuthResquestToken ''' Exemplo de uso com jquery ''' <pre> $.ajax({ type: 'POST', url: _tok...')
 
 
(4 revisões intermediárias pelo mesmo usuário não estão sendo mostradas)
Linha 1: Linha 1:
 +
== GenerateAuthResquestToken ==
 +
 
* Endereço: https://tokengen.latromi.com.br/TokenGenService.svc/rest/generateAuthResquestToken
 
* Endereço: https://tokengen.latromi.com.br/TokenGenService.svc/rest/generateAuthResquestToken
  
 
''' Exemplo de uso com jquery '''
 
''' Exemplo de uso com jquery '''
<pre>
+
<syntaxhighlight lang="JavaScript">
 +
// Usuário e senha que serão usados para gerar o Token
 +
var reqTokenArgs = {
 +
  username: 'username',
 +
  password: 'password'
 +
};
 +
 
 
$.ajax({
 
$.ajax({
 
   type: 'POST',
 
   type: 'POST',
   url: _tokenGenURL,
+
   url: 'https://tokengen.latromi.com.br/TokenGenService.svc/rest/generateAuthResquestToken',
   data: JSON.stringify(authReqTokenArgs),
+
   data: JSON.stringify(reqTokenArgs ),
 
   dataType: 'json',
 
   dataType: 'json',
 
   contentType: 'application/json; charset=utf-8',
 
   contentType: 'application/json; charset=utf-8',
 
   success: function(result){
 
   success: function(result){
       authenticate(result)
+
       alert('Token de requisição: ' + result);
 
   },
 
   },
 
   error: function (req, status, error) {
 
   error: function (req, status, error) {
       setMessage('Erro: ' + error, 'ERROR');
+
       alert('Erro: ' + error);
 
   }
 
   }
 
});
 
});
 +
</syntaxhighlight>
 +
 +
== GenerateChangePasswordToken ==
  
 +
* Endereço: https://tokengen.latromi.com.br/TokenGenService.svc/rest/GenerateChangePasswordToken
  
</pre>
+
''' Exemplo de uso com jquery '''
 +
<syntaxhighlight lang="JavaScript">
 +
// Usuário, senha e nova senha que serão usados para gerar o Token
 +
var reqTokenArgs = {
 +
  username: 'username',
 +
  password: 'password',
 +
  passwordNew: 'new password',
 +
};
 +
 
 +
$.ajax({
 +
  type: 'POST',
 +
  url: 'https://tokengen.latromi.com.br/TokenGenService.svc/rest/generateChangePasswordToken',
 +
  data: JSON.stringify(reqTokenArgs),
 +
  dataType: 'json',
 +
  contentType: 'application/json; charset=utf-8',
 +
  success: function(result){
 +
      alert('Token de requisição: ' + result);
 +
  },
 +
  error: function (req, status, error) {
 +
      alert('Erro: ' + error);
 +
  }
 +
});
 +
</syntaxhighlight>

Edição atual tal como às 11h41min de 3 de setembro de 2019

GenerateAuthResquestToken

Exemplo de uso com jquery

// Usuário e senha que serão usados para gerar o Token
var reqTokenArgs = {
   username: 'username',
   password: 'password'
};

$.ajax({
   type: 'POST',
   url: 'https://tokengen.latromi.com.br/TokenGenService.svc/rest/generateAuthResquestToken',
   data: JSON.stringify(reqTokenArgs ),
   dataType: 'json',
   contentType: 'application/json; charset=utf-8',
   success: function(result){
      alert('Token de requisição: ' + result);
   },
   error: function (req, status, error) {
      alert('Erro: ' + error);
   }
});

GenerateChangePasswordToken

Exemplo de uso com jquery

// Usuário, senha e nova senha que serão usados para gerar o Token
var reqTokenArgs = {
   username: 'username',
   password: 'password',
   passwordNew: 'new password',
};

$.ajax({
   type: 'POST',
   url: 'https://tokengen.latromi.com.br/TokenGenService.svc/rest/generateChangePasswordToken',
   data: JSON.stringify(reqTokenArgs),
   dataType: 'json',
   contentType: 'application/json; charset=utf-8',
   success: function(result){
      alert('Token de requisição: ' + result);
   },
   error: function (req, status, error) {
      alert('Erro: ' + error);
   }
});