Modify a subaccount with Node JS

Modify a subaccount with Node JS


Modify a subaccount with Node JS

Example in Node JS:

var aclass = "subaccount";
var method = "modifysubaccount";
var user = "user";
var password = "password";
var accountemail = "";
var modifypassword = "1";
var accountpassword = "password";
var namelastname = "name+lastname";
var iscompany = "1";
var companyname = "mycompany";
var documentid = "123456789A";
var language = "en";
var countrycode = "us";
var cityid = "1";
var cityname = "town";
var zipcode = "123456";
var address = "address";

const https = require('https')
const options = {
  hostname: '',
  port: 443,
  path: '/api/http/?class='+aclass+'&method='+method+'&user='+user+'&password='+password+'&accountemail='+accountemail+'&modifypassword='+modifypassword+'&accountpassword='+accountpassword+'&namelastname='+namelastname+'&iscompany='+iscompany+'&companyname='+companyname+'&documentid='+documentid+'&language='+language+'&countrycode='+countrycode+'&cityid='+cityid+'&cityname='+cityname+'&zipcode='+zipcode+'&address='+address,
  method: 'GET'

const req = https.request(options, res => {
  res.on('data', d => {
	// Do something

req.on('error', error => {


See example in:

Modify a subaccount with PHP Modify a subaccount with Java Modify a subaccount with C Sharp Modify a subaccount with Unix Modify a subaccount with Ruby on rails Modify a subaccount with Python Modify a subaccount with Android Modify a subaccount with Objective C / iPhone Modify a subaccount with SQL Server Modify a subaccount with Oracle Modify a subaccount with Node JS Modify a subaccount with Go lang Modify a subaccount with Scala lang Modify a subaccount with Swift Modify a subaccount with Delphi

Method details

Parameter Description Compulsory / Optional
class=subaccount Class requested: Class to which the request is made Compulsory
method=modifysubaccount Class method requested: Method of the class to which the request is made Compulsory
user User and e-mail of your Afilnet account Compulsory
password Password of your Afilnet account Compulsory
accountemail Account email Compulsory
modifypassword Compulsory
accountpassword Account password Optional
namelastname Name and surname of the contact person Compulsory
iscompany (0) If it is a natural person or (1) if it is a company Compulsory
companyname Name of the company (in case it is a company) Optional
documentid Company identification document code Compulsory
language Language of the subaccount. See attached table Compulsory
countrycode ISO country code in ISO-3166-1 ALPHA-2 format Compulsory
cityid City identifier Compulsory
cityname Name of the city or town to which it belongs Compulsory
zipcode Postal Code Compulsory
address Physical address Compulsory

When you make requests you will receive the following fields:

  •  status
  •   result (if status=success), here you will receive the following values:
    • No additional values will be sent to you
  • error (if status=error), here you will receive the error code

The possible error codes are listed below

Code Description
MISSING_USER User or email not included
MISSING_PASSWORD Password not included
MISSING_CLASS Class not included
MISSING_METHOD Method not included
MISSING_COMPULSORY_PARAM Compulsory parameter not included
INCORRECT_USER_PASSWORD Incorrect user or password
INCORRECT_CLASS Incorrect class
INCORRECT_METHOD Incorrect method
EMPTY_COUNTRYCODE The country code is empty
EMPTY_FIELDS Some mandatory field is empty
COUNTRY_NOT_FOUND There is no country with the indicated code
EMPTY_CITY You have not indicated the city
CITY_NOT_FOUND The indicated city does not exist
INCORRECT_EMAIL The email included is not valid
INCORRECT_PASSWORD The password included is not valid
ACCOUNT_NOT_FOUND User account has not been found
  • class : subaccount
  • method : modifysubaccount
  • user : user
  • password : password
  • accountemail :
  • modifypassword : 1
  • accountpassword : password
  • namelastname : name+lastname
  • iscompany : 1
  • companyname : mycompany
  • documentid : 123456789A
  • language : en
  • countrycode : us
  • cityid : 1
  • cityname : town
  • zipcode : 123456
  • address : address


Connect Node JS with our Subaccounts API

Our Subaccounts API allows you Modify a subaccount with Node JS in a simple, fast and efficient way. The process you must follow in order to use our API will only take a few minutes. Our company will offer you a free trial so that you can test the service.

Steps to follow

  • Register as a client on Afilnet.
  • Request a test or top up your balance.
  • Start using the API with your registration data (data that you must include in the "user" and "password" fields) or by creating new API credentials from your Afilnet account.

Get started now with the Afilnet API!

Do you have any questions or problems in the integration?

Contact our team with any questions through the contact methods that we offer. Our team will try to offer you an immediate solution and will help you in the integration of our API in your Software.

Try Afilnet for free!

You are just one step away from changing your company's communication forever, from today you will capture and retain your customers better thanks to Afilnet services.

Bulk SMS · Email Marketing · Social network · Instant messaging · Certification · and much more

Register in 1 minute

Register for free and try Afilnet today *

(*) Promotion only valid for companies that have never used the Afilnet service before, only free credit is provided for SMS and Email Marketing services. When requesting the free balance, Afilnet may contact you to verify your company information

IMPORTANT INFORMATION ABOUT COOKIES: If you continue to use this web we will assume that you accept the terms of use. You will find more information in our Cookies Policy. Continue

Payment methods

  • Wire transfer
    Credit card
    Western Union

Afilnet in your language

Afilnet EspañaAfilnet United KingdomAfilnet FranceAfilnet DeutschlandAfilnet ItaliaAfilnet PortugalAfilnet 中国Afilnet 日本Afilnet الإمارات العربية المتحدةAfilnet EstoniaAfilnet PolskaAfilnet РоссияAfilnet TürkiyeAfilnet Česká republikaAfilnet ΕλλάδαAfilnet SverigeAfilnet DanmarkAfilnet România

Copyright © 2021 Afilnet · All rights reserved