Yogesh Gogia • about 11 years ago
URGENT!!! Cannot register new users in JS SDK ?
I edited the sample application code (register.html) available in Quick Start Guide of candy, with Account key and secret in the KandyAPI.Registration.getConfiguration() but it always fails to retrieve the configuration and an alert comes with message Call to getConfiguration() failed. Without configurations i cannot further use the KandyAPI.Registration.register(), Is there anything i am doing wrong?
I have also tried using the REST API i can succesfully retrieve the domain_access_token using the following code-
function getDat() {
var tokens={
"key": "***********************************************",
"domain_api_secret": "****************************************"
}
$.ajax({
type: "GET",
url: "https://api.kandy.io/v1.1/domains/accesstokens",
async: false,
data: tokens,
dataType: "json",
success: function(data){
domainAccessToken=data.result.domain_access_token;
$("#domain_access_token").val(domainAccessToken);
}
});
}
but when it shows a 404 in console when i try the same for creating a new user.
my code is:-
$('#create-btn').on('click', function() {
var tokens={
"key": domainAccessToken,
"user_id": "ygogiabest",
"user_country_code": "IN",
"user_first_name": "Yogesh",
"user_last_name": "Gogia",
"user_email": "ygogia@gmail.com",
"user_password": "qwertyuiop",
"user_phone_number": "7895466852"
}
$.ajax({
type: "GET",
url: "https://api.kandy.io/v1.1/domains/users/user_id",
async: false,
data: tokens,
dataType: "json",
success: function(data){
alert(data.message);
}
});
});
Is there anything i am doing wrong? or is there any other method to register a new user..?
Comments are closed.

1 comment
srbaskar • about 11 years ago
Hi Yogesh,
Please try API key in the url instead of body data.
Thanks,
Srini