Closed prakashsam closed 6 years ago
Have you already granted calls before like this ? It should be just one time. See Readme for more informations
var ovh = require('ovh')({
endpoint: 'ovh-eu',
appKey: 'YOUR_APP_KEY',
appSecret: 'YOUR_APP_SECRET'
});
ovh.request('POST', '/auth/credential', {
'accessRules': [
{ 'method': 'GET', 'path': '/*'},
{ 'method': 'POST', 'path': '/*'},
{ 'method': 'PUT', 'path': '/*'},
{ 'method': 'DELETE', 'path': '/*'}
]
}, function (error, credential) {
console.log(error || credential);
});
Hi Bnjjj, Using this Url : https://eu.api.ovh.com/createToken/ i got right access for POST method then i got app key, app secret key and consumer key. or need to call every time in below code if i call below code i got every time new consumer key...using this CK in below Send sms API
var ovh = require('ovh')({
endpoint: 'ovh-eu',
appKey: 'YOUR_APP_KEY',
appSecret: 'YOUR_APP_SECRET'
});
ovh.request('POST', '/auth/credential', {
'accessRules': [
{ 'method': 'GET', 'path': '/*'},
{ 'method': 'POST', 'path': '/*'},
{ 'method': 'PUT', 'path': '/*'},
{ 'method': 'DELETE', 'path': '/*'}
]
}, function (error, credential) {
console.log(error || credential);
});
//Send sms API
ovh.request('GET', '/me', function (err, me) {
console.log(err || me);
});
ovh.request('POST', '/sms/{serviceName}/jobs', {
serviceName: 'sms-aaXXXXX-1',
message: 'sms testing ',
sender: 'Foo',
receivers: ['+3360000000']
}, function (err, result) {
console.log(err || result);
});
Call the first part just one time in order to get you CK.
But i got app and consumer keys from this https://eu.api.ovh.com/createToken/ url right acces for GET /sms/ GET/sms//jobs/ POST /sms//jobs/
Got same error 403: 'This call has not been granted' 1.First time generated consumer key using code onyl GET access
var ovh = require('ovh')({ endpoint: 'ovh-eu', appKey: 'YOUR_APP_KEY', appSecret: 'YOUR_APP_SECRET' });
ovh.request('POST', '/auth/credential', { 'accessRules': [ { 'method': 'GET', 'path': '/*'}, ] }, function (error, credential) { console.log(error || credential); });
Anything Wrong?
Hi Bnjjj, Can i create another app using https://ca.api.kimsufi.com/createApp/ and try again ?? #
Yes but make sure to use the good endpoint param. Not ‘ovh-eu’
Yes got it, development center in India, for this application only use for France. can i use this endpoint : https://eu.api.ovh.com or endpoint: 'ovh-eu',
yes if you have an eu ovh account
working fine
Create app key, app secret key and consumer key and configured then cal this function i got error 403: 'This call has not been granted'.