Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Repository files navigation

Getting started

The general-purpose API

Initialization

Authentication

In order to setup authentication and initialization of the API client, you need the following information.

ParameterDescription
userIdYour user ID
apiKeyYour API key

API client can be initialized as following.

// Configuration parameters and credentialsStringuserId = "userId"; // Your user IDStringapiKey = "apiKey"; // Your API keyNeutrinoAPIClientclient = newNeutrinoAPIClient(userId, apiKey);

Class Reference

List of Controllers

Class: Imaging

Get singleton instance

The singleton instance of the Imaging class can be accessed from the API Client.

Imagingimaging = client.getImaging();

Method: imageResizeAsync

Resize an image and output as either JPEG or PNG. See: https://www.neutrinoapi.com/api/image-resize/

voidimageResizeAsync(
finalStringimageUrl,
finalintwidth,
finalintheight,
finalStringformat,
finalAPICallBack<InputStream> callBack)

Parameters

ParameterTagsDescription
imageUrlRequiredThe URL to the source image
widthRequiredThe width to resize to (in px) while preserving aspect ratio
heightRequiredThe height to resize to (in px) while preserving aspect ratio
formatOptionalDefaultValueThe output image format, can be either png or jpg

Example Usage

StringimageUrl = "image-url";
intwidth = 27;
intheight = 27;
Stringformat = "png";
// Invoking the API call with sample inputsimaging.imageResizeAsync(imageUrl, width, height, format, newAPICallBack<InputStream>() {
publicvoidonSuccess(HttpContextcontext, InputStreamresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: qRCodeAsync

Generate a QR code as a PNG image. See: https://www.neutrinoapi.com/api/qr-code/

voidqRCodeAsync(
finalStringcontent,
finalIntegerwidth,
finalIntegerheight,
finalStringfgColor,
finalStringbgColor,
finalAPICallBack<InputStream> callBack)

Parameters

ParameterTagsDescription
contentRequiredThe content to encode into the QR code (e.g. a URL or a phone number)
widthOptionalDefaultValueThe width of the QR code (in px)
heightOptionalDefaultValueThe height of the QR code (in px)
fgColorOptionalDefaultValueThe QR code foreground color
bgColorOptionalDefaultValueThe QR code background color

Example Usage

Stringcontent = "content";
Integerwidth = 256;
Integerheight = 256;
StringfgColor = "#000000";
StringbgColor = "#ffffff";
// Invoking the API call with sample inputsimaging.qRCodeAsync(content, width, height, fgColor, bgColor, newAPICallBack<InputStream>() {
publicvoidonSuccess(HttpContextcontext, InputStreamresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: imageWatermarkAsync

Watermark one image with another image. See: https://www.neutrinoapi.com/api/image-watermark/

voidimageWatermarkAsync(
finalStringimageUrl,
finalStringwatermarkUrl,
finalIntegeropacity,
finalStringformat,
finalStringposition,
finalIntegerwidth,
finalIntegerheight,
finalAPICallBack<InputStream> callBack)

Parameters

ParameterTagsDescription
imageUrlRequiredThe URL to the source image
watermarkUrlRequiredThe URL to the watermark image
opacityOptionalDefaultValueThe opacity of the watermark (0 to 100)
formatOptionalDefaultValueThe output image format, can be either png or jpg
positionOptionalDefaultValueThe position of the watermark image, possible values are: center, top-left, top-center, top-right, bottom-left, bottom-center, bottom-right
widthOptionalIf set resize the resulting image to this width (in px) while preserving aspect ratio
heightOptionalIf set resize the resulting image to this height (in px) while preserving aspect ratio

Example Usage

StringimageUrl = "image-url";
StringwatermarkUrl = "watermark-url";
Integeropacity = 50;
Stringformat = "png";
Stringposition = "center";
Integerwidth = 27;
Integerheight = 27;
// Invoking the API call with sample inputsimaging.imageWatermarkAsync(imageUrl, watermarkUrl, opacity, format, position, width, height, newAPICallBack<InputStream>() {
publicvoidonSuccess(HttpContextcontext, InputStreamresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: hTML5RenderAsync

Render HTML content to PDF, JPG or PNG. See: https://www.neutrinoapi.com/api/html5-render/

voidhTML5RenderAsync(
finalStringcontent,
finalStringformat,
finalStringpageSize,
finalStringtitle,
finalIntegermargin,
finalIntegermarginLeft,
finalIntegermarginRight,
finalIntegermarginTop,
finalIntegermarginBottom,
finalBooleanlandscape,
finalIntegerzoom,
finalBooleangrayscale,
finalBooleanmediaPrint,
finalBooleanmediaQueries,
finalBooleanforms,
finalStringcss,
finalIntegerimageWidth,
finalIntegerimageHeight,
finalIntegerrenderDelay,
finalStringheaderTextLeft,
finalStringheaderTextCenter,
finalStringheaderTextRight,
finalIntegerheaderSize,
finalStringheaderFont,
finalIntegerheaderFontSize,
finalBooleanheaderLine,
finalStringfooterTextLeft,
finalStringfooterTextCenter,
finalStringfooterTextRight,
finalIntegerfooterSize,
finalStringfooterFont,
finalIntegerfooterFontSize,
finalBooleanfooterLine,
finalIntegerpageWidth,
finalIntegerpageHeight,
finalAPICallBack<InputStream> callBack)

Parameters

ParameterTagsDescription
contentRequiredThe HTML content. This can be either a URL to load HTML from or an actual HTML content string
formatOptionalDefaultValueWhich format to output, available options are: PDF, PNG, JPG
pageSizeOptionalDefaultValueSet the document page size, can be one of: A0 - A9, B0 - B10, Comm10E, DLE or Letter
titleOptionalThe document title
marginOptionalDefaultValueThe document margin (in mm)
marginLeftOptionalDefaultValueThe document left margin (in mm)
marginRightOptionalDefaultValueThe document right margin (in mm)
marginTopOptionalDefaultValueThe document top margin (in mm)
marginBottomOptionalDefaultValueThe document bottom margin (in mm)
landscapeOptionalDefaultValueSet the document to lanscape orientation
zoomOptionalDefaultValueSet the zoom factor when rendering the page (2.0 for double size, 0.5 for half size)
grayscaleOptionalDefaultValueRender the final document in grayscale
mediaPrintOptionalDefaultValueUse @media print CSS styles to render the document
mediaQueriesOptionalDefaultValueActivate all @media queries before rendering. This can be useful if you wan't to render the mobile version of a responsive website
formsOptionalDefaultValueGenerate real (fillable) PDF forms from HTML forms
cssOptionalInject custom CSS into the HTML. e.g. 'body { background-color: red;}'
imageWidthOptionalDefaultValueIf rendering to an image format (PNG or JPG) use this image width (in pixels)
imageHeightOptionalIf rendering to an image format (PNG or JPG) use this image height (in pixels). The default is automatic which dynamically sets the image height based on the content
renderDelayOptionalDefaultValueNumber of milliseconds to wait before rendering the page (can be useful for pages with animations etc)
headerTextLeftOptionalText to print to the left-hand side header of each page. e.g. 'My header - Page {page_number} of {total_pages}'
headerTextCenterOptionalText to print to the center header of each page
headerTextRightOptionalText to print to the right-hand side header of each page
headerSizeOptionalDefaultValueThe height of your header (in mm)
headerFontOptionalDefaultValueSet the header font. Fonts available: Times, Courier, Helvetica, Arial
headerFontSizeOptionalDefaultValueSet the header font size (in pt)
headerLineOptionalDefaultValueDraw a full page width horizontal line under your header
footerTextLeftOptionalText to print to the left-hand side footer of each page. e.g. 'My footer - Page {page_number} of {total_pages}'
footerTextCenterOptionalText to print to the center header of each page
footerTextRightOptionalText to print to the right-hand side header of each page
footerSizeOptionalDefaultValueThe height of your footer (in mm)
footerFontOptionalDefaultValueSet the footer font. Fonts available: Times, Courier, Helvetica, Arial
footerFontSizeOptionalDefaultValueSet the footer font size (in pt)
footerLineOptionalDefaultValueDraw a full page width horizontal line above your footer
pageWidthOptionalSet the PDF page width explicitly (in mm)
pageHeightOptionalSet the PDF page height explicitly (in mm)

Example Usage

Stringcontent = "content";
Stringformat = "PDF";
StringpageSize = "A4";
Stringtitle = "title";
Integermargin = 0;
IntegermarginLeft = 0;
IntegermarginRight = 0;
IntegermarginTop = 0;
IntegermarginBottom = 0;
Booleanlandscape = false;
Integerzoom = 1;
Booleangrayscale = false;
BooleanmediaPrint = false;
BooleanmediaQueries = false;
Booleanforms = false;
Stringcss = "css";
IntegerimageWidth = 1024;
IntegerimageHeight = 27;
IntegerrenderDelay = 0;
StringheaderTextLeft = "header-text-left";
StringheaderTextCenter = "header-text-center";
StringheaderTextRight = "header-text-right";
IntegerheaderSize = 9;
StringheaderFont = "Courier";
IntegerheaderFontSize = 11;
BooleanheaderLine = false;
StringfooterTextLeft = "footer-text-left";
StringfooterTextCenter = "footer-text-center";
StringfooterTextRight = "footer-text-right";
IntegerfooterSize = 9;
StringfooterFont = "Courier";
IntegerfooterFontSize = 11;
BooleanfooterLine = false;
IntegerpageWidth = 118;
IntegerpageHeight = 118;
// Invoking the API call with sample inputsimaging.hTML5RenderAsync(content, format, pageSize, title, margin, marginLeft, marginRight, marginTop, marginBottom, landscape, zoom, grayscale, mediaPrint, mediaQueries, forms, css, imageWidth, imageHeight, renderDelay, headerTextLeft, headerTextCenter, headerTextRight, headerSize, headerFont, headerFontSize, headerLine, footerTextLeft, footerTextCenter, footerTextRight, footerSize, footerFont, footerFontSize, footerLine, pageWidth, pageHeight, newAPICallBack<InputStream>() {
publicvoidonSuccess(HttpContextcontext, InputStreamresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Back to List of Controllers

Class: Telephony

Get singleton instance

The singleton instance of the Telephony class can be accessed from the API Client.

Telephonytelephony = client.getTelephony();

Method: verifySecurityCodeAsync

Check if a security code from one of the verify APIs is valid. See: https://www.neutrinoapi.com/api/verify-security-code/

voidverifySecurityCodeAsync(
finalStringsecurityCode,
finalAPICallBack<VerifySecurityCodeResponse> callBack)

Parameters

ParameterTagsDescription
securityCodeRequiredThe security code to verify

Example Usage

StringsecurityCode = "security-code";
// Invoking the API call with sample inputstelephony.verifySecurityCodeAsync(securityCode, newAPICallBack<VerifySecurityCodeResponse>() {
publicvoidonSuccess(HttpContextcontext, VerifySecurityCodeResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: hLRLookupAsync

Connect to the global mobile cellular network and retrieve the status of a mobile device. See: https://www.neutrinoapi.com/api/hlr-lookup/

voidhLRLookupAsync(
finalStringnumber,
finalStringcountryCode,
finalAPICallBack<HLRLookupResponse> callBack)

Parameters

ParameterTagsDescription
numberRequiredA phone number
countryCodeOptionalISO 2-letter country code, assume numbers are based in this country. If not set numbers are assumed to be in international format (with or without the leading + sign)

Example Usage

Stringnumber = "number";
StringcountryCode = "country-code";
// Invoking the API call with sample inputstelephony.hLRLookupAsync(number, countryCode, newAPICallBack<HLRLookupResponse>() {
publicvoidonSuccess(HttpContextcontext, HLRLookupResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: phonePlaybackAsync

Make an automated call to any valid phone number and playback an audio message. See: https://www.neutrinoapi.com/api/phone-playback/

voidphonePlaybackAsync(
finalStringnumber,
finalStringaudioUrl,
finalAPICallBack<PhonePlaybackResponse> callBack)

Parameters

ParameterTagsDescription
numberRequiredThe phone number to call. Must be in valid international format
audioUrlRequiredA URL to a valid audio file. Accepted audio formats are:
  • MP3
  • WAV
  • OGG
You can use the following MP3 URL for testing: https://www.neutrinoapi.com/test-files/test1.mp3

Example Usage

Stringnumber = "number";
StringaudioUrl = "audio-url";
// Invoking the API call with sample inputstelephony.phonePlaybackAsync(number, audioUrl, newAPICallBack<PhonePlaybackResponse>() {
publicvoidonSuccess(HttpContextcontext, PhonePlaybackResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: sMSVerifyAsync

Send a unique security code to any mobile device via SMS. See: https://www.neutrinoapi.com/api/sms-verify/

voidsMSVerifyAsync(
finalStringnumber,
finalIntegercodeLength,
finalIntegersecurityCode,
finalStringcountryCode,
finalStringlanguageCode,
finalAPICallBack<SMSVerifyResponse> callBack)

Parameters

ParameterTagsDescription
numberRequiredThe phone number to send a verification code to
codeLengthOptionalDefaultValueThe number of digits to use in the security code (must be between 4 and 12)
securityCodeOptionalPass in your own security code. This is useful if you have implemented TOTP or similar 2FA methods. If not set then we will generate a secure random code
countryCodeOptionalISO 2-letter country code, assume numbers are based in this country. If not set numbers are assumed to be in international format (with or without the leading + sign)
languageCodeOptionalDefaultValueThe language to send the verification code in, available languages are:
  • de - German
  • en - English
  • es - Spanish
  • fr - French
  • it - Italian
  • pt - Portuguese
  • ru - Russian

Example Usage

Stringnumber = "number";
IntegercodeLength = 5;
IntegersecurityCode = 118;
StringcountryCode = "country-code";
StringlanguageCode = "en";
// Invoking the API call with sample inputstelephony.sMSVerifyAsync(number, codeLength, securityCode, countryCode, languageCode, newAPICallBack<SMSVerifyResponse>() {
publicvoidonSuccess(HttpContextcontext, SMSVerifyResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: sMSMessageAsync

Send a free-form message to any mobile device via SMS. See: https://www.neutrinoapi.com/api/sms-message/

voidsMSMessageAsync(
finalStringnumber,
finalStringmessage,
finalStringcountryCode,
finalAPICallBack<SMSMessageResponse> callBack)

Parameters

ParameterTagsDescription
numberRequiredThe phone number to send a message to
messageRequiredThe SMS message to send. Messages are truncated to a maximum of 150 characters for ASCII content OR 70 characters for UTF content
countryCodeOptionalISO 2-letter country code, assume numbers are based in this country. If not set numbers are assumed to be in international format (with or without the leading + sign)

Example Usage

Stringnumber = "number";
Stringmessage = "message";
StringcountryCode = "country-code";
// Invoking the API call with sample inputstelephony.sMSMessageAsync(number, message, countryCode, newAPICallBack<SMSMessageResponse>() {
publicvoidonSuccess(HttpContextcontext, SMSMessageResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: phoneVerifyAsync

Make an automated call to any valid phone number and playback a unique security code. See: https://www.neutrinoapi.com/api/phone-verify/

voidphoneVerifyAsync(
finalStringnumber,
finalIntegercodeLength,
finalIntegersecurityCode,
finalIntegerplaybackDelay,
finalStringcountryCode,
finalStringlanguageCode,
finalAPICallBack<PhoneVerifyResponse> callBack)

Parameters

ParameterTagsDescription
numberRequiredThe phone number to send the verification code to
codeLengthOptionalDefaultValueThe number of digits to use in the security code (between 4 and 12)
securityCodeOptionalPass in your own security code. This is useful if you have implemented TOTP or similar 2FA methods. If not set then we will generate a secure random code
playbackDelayOptionalDefaultValueThe delay in milliseconds between the playback of each security code
countryCodeOptionalISO 2-letter country code, assume numbers are based in this country. If not set numbers are assumed to be in international format (with or without the leading + sign)
languageCodeOptionalDefaultValueThe language to playback the verification code in, available languages are:
  • de - German
  • en - English
  • es - Spanish
  • fr - French
  • it - Italian
  • pt - Portuguese
  • ru - Russian

Example Usage

Stringnumber = "number";
IntegercodeLength = 6;
IntegersecurityCode = 118;
IntegerplaybackDelay = 800;
StringcountryCode = "country-code";
StringlanguageCode = "en";
// Invoking the API call with sample inputstelephony.phoneVerifyAsync(number, codeLength, securityCode, playbackDelay, countryCode, languageCode, newAPICallBack<PhoneVerifyResponse>() {
publicvoidonSuccess(HttpContextcontext, PhoneVerifyResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Back to List of Controllers

Class: DataTools

Get singleton instance

The singleton instance of the DataTools class can be accessed from the API Client.

DataToolsdataTools = client.getDataTools();

Method: emailValidateAsync

Parse, validate and clean an email address. See: https://www.neutrinoapi.com/api/email-validate/

voidemailValidateAsync(
finalStringemail,
finalBooleanfixTypos,
finalAPICallBack<EmailValidateResponse> callBack)

Parameters

ParameterTagsDescription
emailRequiredAn email address
fixTyposOptionalDefaultValueAutomatically attempt to fix typos in the address

Example Usage

Stringemail = "email";
BooleanfixTypos = false;
// Invoking the API call with sample inputsdataTools.emailValidateAsync(email, fixTypos, newAPICallBack<EmailValidateResponse>() {
publicvoidonSuccess(HttpContextcontext, EmailValidateResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: userAgentInfoAsync

Parse, validate and get detailed user-agent information from a user agent string. See: https://www.neutrinoapi.com/api/user-agent-info/

voiduserAgentInfoAsync(
finalStringuserAgent,
finalAPICallBack<UserAgentInfoResponse> callBack)

Parameters

ParameterTagsDescription
userAgentRequiredA user agent string

Example Usage

StringuserAgent = "user-agent";
// Invoking the API call with sample inputsdataTools.userAgentInfoAsync(userAgent, newAPICallBack<UserAgentInfoResponse>() {
publicvoidonSuccess(HttpContextcontext, UserAgentInfoResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: badWordFilterAsync

Detect bad words, swear words and profanity in a given text. See: https://www.neutrinoapi.com/api/bad-word-filter/

voidbadWordFilterAsync(
finalStringcontent,
finalStringcensorCharacter,
finalAPICallBack<BadWordFilterResponse> callBack)

Parameters

ParameterTagsDescription
contentRequiredThe content to scan. This can be either a URL to load content from or an actual content string
censorCharacterOptionalThe character to use to censor out the bad words found

Example Usage

Stringcontent = "content";
StringcensorCharacter = "censor-character";
// Invoking the API call with sample inputsdataTools.badWordFilterAsync(content, censorCharacter, newAPICallBack<BadWordFilterResponse>() {
publicvoidonSuccess(HttpContextcontext, BadWordFilterResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: convertAsync

A powerful unit conversion tool. See: https://www.neutrinoapi.com/api/convert/

voidconvertAsync(
finalStringfromValue,
finalStringfromType,
finalStringtoType,
finalAPICallBack<ConvertResponse> callBack)

Parameters

ParameterTagsDescription
fromValueRequiredThe value to convert from (e.g. 10.95)
fromTypeRequiredThe type of the value to convert from (e.g. USD)
toTypeRequiredThe type to convert to (e.g. EUR)

Example Usage

StringfromValue = "from-value";
StringfromType = "from-type";
StringtoType = "to-type";
// Invoking the API call with sample inputsdataTools.convertAsync(fromValue, fromType, toType, newAPICallBack<ConvertResponse>() {
publicvoidonSuccess(HttpContextcontext, ConvertResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: phoneValidateAsync

Parse, validate and get location information about a phone number. See: https://www.neutrinoapi.com/api/phone-validate/

voidphoneValidateAsync(
finalStringnumber,
finalStringcountryCode,
finalStringip,
finalAPICallBack<PhoneValidateResponse> callBack)

Parameters

ParameterTagsDescription
numberRequiredA phone number. This can be in international format (E.164) or local format. If passing local format you should use the 'country-code' or 'ip' options as well
countryCodeOptionalISO 2-letter country code, assume numbers are based in this country. If not set numbers are assumed to be in international format (with or without the leading + sign)
ipOptionalPass in a users IP address and we will assume numbers are based in the country of the IP address

Example Usage

Stringnumber = "number";
StringcountryCode = "country-code";
Stringip = "ip";
// Invoking the API call with sample inputsdataTools.phoneValidateAsync(number, countryCode, ip, newAPICallBack<PhoneValidateResponse>() {
publicvoidonSuccess(HttpContextcontext, PhoneValidateResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Back to List of Controllers

Class: SecurityAndNetworking

Get singleton instance

The singleton instance of the SecurityAndNetworking class can be accessed from the API Client.

SecurityAndNetworkingsecurityAndNetworking = client.getSecurityAndNetworking();

Method: iPProbeAsync

Analyze and extract provider information for an IP address. See: https://www.neutrinoapi.com/api/ip-probe/

voidiPProbeAsync(
finalStringip,
finalAPICallBack<IPProbeResponse> callBack)

Parameters

ParameterTagsDescription
ipRequiredIPv4 or IPv6 address

Example Usage

Stringip = "ip";
// Invoking the API call with sample inputssecurityAndNetworking.iPProbeAsync(ip, newAPICallBack<IPProbeResponse>() {
publicvoidonSuccess(HttpContextcontext, IPProbeResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: emailVerifyAsync

SMTP based email address verification. See: https://www.neutrinoapi.com/api/email-verify/

voidemailVerifyAsync(
finalStringemail,
finalBooleanfixTypos,
finalAPICallBack<EmailVerifyResponse> callBack)

Parameters

ParameterTagsDescription
emailRequiredAn email address
fixTyposOptionalDefaultValueAutomatically attempt to fix typos in the address

Example Usage

Stringemail = "email";
BooleanfixTypos = false;
// Invoking the API call with sample inputssecurityAndNetworking.emailVerifyAsync(email, fixTypos, newAPICallBack<EmailVerifyResponse>() {
publicvoidonSuccess(HttpContextcontext, EmailVerifyResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: iPBlocklistAsync

The IP Blocklist API will detect potentially malicious or dangerous IP addresses. See: https://www.neutrinoapi.com/api/ip-blocklist/

voidiPBlocklistAsync(
finalStringip,
finalAPICallBack<IPBlocklistResponse> callBack)

Parameters

ParameterTagsDescription
ipRequiredAn IPv4 or IPv6 address

Example Usage

Stringip = "ip";
// Invoking the API call with sample inputssecurityAndNetworking.iPBlocklistAsync(ip, newAPICallBack<IPBlocklistResponse>() {
publicvoidonSuccess(HttpContextcontext, IPBlocklistResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: hostReputationAsync

Check the reputation of an IP address, domain name, FQDN or URL against a comprehensive list of blacklists and blocklists. See: https://www.neutrinoapi.com/api/host-reputation/

voidhostReputationAsync(
finalStringhost,
finalIntegerlistRating,
finalAPICallBack<HostReputationResponse> callBack)

Parameters

ParameterTagsDescription
hostRequiredAn IP address, domain name, FQDN or URL. If you supply a domain/URL it will be checked against the URI DNSBL lists
listRatingOptionalDefaultValueOnly check lists with this rating or better

Example Usage

Stringhost = "host";
IntegerlistRating = 3;
// Invoking the API call with sample inputssecurityAndNetworking.hostReputationAsync(host, listRating, newAPICallBack<HostReputationResponse>() {
publicvoidonSuccess(HttpContextcontext, HostReputationResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Back to List of Controllers

Class: Geolocation

Get singleton instance

The singleton instance of the Geolocation class can be accessed from the API Client.

Geolocationgeolocation = client.getGeolocation();

Method: geocodeReverseAsync

Convert a geographic coordinate (latitude and longitude) into a real world address. See: https://www.neutrinoapi.com/api/geocode-reverse/

voidgeocodeReverseAsync(
finalStringlatitude,
finalStringlongitude,
finalStringlanguageCode,
finalStringzoom,
finalAPICallBack<GeocodeReverseResponse> callBack)

Parameters

ParameterTagsDescription
latitudeRequiredThe location latitude in decimal degrees format
longitudeRequiredThe location longitude in decimal degrees format
languageCodeOptionalDefaultValueThe language to display results in, available languages are:
  • de, en, es, fr, it, pt, ru
zoomOptionalDefaultValueThe zoom level to respond with:
  • address - the most precise address available
  • street - the street level
  • city - the city level
  • state - the state level
  • country - the country level

Example Usage

Stringlatitude = "latitude";
Stringlongitude = "longitude";
StringlanguageCode = "en";
Stringzoom = "address";
// Invoking the API call with sample inputsgeolocation.geocodeReverseAsync(latitude, longitude, languageCode, zoom, newAPICallBack<GeocodeReverseResponse>() {
publicvoidonSuccess(HttpContextcontext, GeocodeReverseResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: iPInfoAsync

Get location information about an IP address and do reverse DNS (PTR) lookups. See: https://www.neutrinoapi.com/api/ip-info/

voidiPInfoAsync(
finalStringip,
finalBooleanreverseLookup,
finalAPICallBack<IPInfoResponse> callBack)

Parameters

ParameterTagsDescription
ipRequiredIPv4 or IPv6 address
reverseLookupOptionalDefaultValueDo a reverse DNS (PTR) lookup. This option can add extra delay to the request so only use it if you need it

Example Usage

Stringip = "ip";
BooleanreverseLookup = false;
// Invoking the API call with sample inputsgeolocation.iPInfoAsync(ip, reverseLookup, newAPICallBack<IPInfoResponse>() {
publicvoidonSuccess(HttpContextcontext, IPInfoResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: geocodeAddressAsync

Geocode an address, partial address or just the name of a place. See: https://www.neutrinoapi.com/api/geocode-address/

voidgeocodeAddressAsync(
finalStringaddress,
finalStringcountryCode,
finalStringlanguageCode,
finalBooleanfuzzySearch,
finalAPICallBack<GeocodeAddressResponse> callBack)

Parameters

ParameterTagsDescription
addressRequiredThe address, partial address or name of a place to try and locate
countryCodeOptionalThe ISO 2-letter country code to be biased towards (the default is no country bias)
languageCodeOptionalDefaultValueThe language to display results in, available languages are:
  • de, en, es, fr, it, pt, ru
fuzzySearchOptionalDefaultValueIf no matches are found for the given address, start performing a recursive fuzzy search until a geolocation is found. This option is recommended for processing user input or implementing auto-complete. We use a combination of approximate string matching and data cleansing to find possible location matches

Example Usage

Stringaddress = "address";
StringcountryCode = "country-code";
StringlanguageCode = "en";
BooleanfuzzySearch = false;
// Invoking the API call with sample inputsgeolocation.geocodeAddressAsync(address, countryCode, languageCode, fuzzySearch, newAPICallBack<GeocodeAddressResponse>() {
publicvoidonSuccess(HttpContextcontext, GeocodeAddressResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Back to List of Controllers

Class: ECommerce

Get singleton instance

The singleton instance of the ECommerce class can be accessed from the API Client.

ECommerceeCommerce = client.getECommerce();

Method: bINLookupAsync

Perform a BIN (Bank Identification Number) or IIN (Issuer Identification Number) lookup. See: https://www.neutrinoapi.com/api/bin-lookup/

voidbINLookupAsync(
finalStringbinNumber,
finalStringcustomerIp,
finalAPICallBack<BINLookupResponse> callBack)

Parameters

ParameterTagsDescription
binNumberRequiredThe BIN or IIN number (the first 6 digits of a credit card number)
customerIpOptionalPass in the customers IP address and we will return some extra information about them

Example Usage

StringbinNumber = "bin-number";
StringcustomerIp = "customer-ip";
// Invoking the API call with sample inputseCommerce.bINLookupAsync(binNumber, customerIp, newAPICallBack<BINLookupResponse>() {
publicvoidonSuccess(HttpContextcontext, BINLookupResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Back to List of Controllers

Class: WWW

Get singleton instance

The singleton instance of the WWW class can be accessed from the API Client.

WWWwWW = client.getWWW();

Method: uRLInfoAsync

Parse, analyze and retrieve content from the supplied URL. See: https://www.neutrinoapi.com/api/url-info/

voiduRLInfoAsync(
finalStringurl,
finalBooleanfetchContent,
finalBooleanignoreCertificateErrors,
finalIntegertimeout,
finalAPICallBack<URLInfoResponse> callBack)

Parameters

ParameterTagsDescription
urlRequiredThe URL to probe
fetchContentOptionalDefaultValueIf this URL responds with html, text, json or xml then return the response. This option is useful if you want to perform further processing on the URL content (e.g. with the HTML Extract or HTML Clean APIs)
ignoreCertificateErrorsOptionalDefaultValueIgnore any TLS/SSL certificate errors and load the URL anyway
timeoutOptionalDefaultValueTimeout in seconds. Give up if still trying to load the URL after this number of seconds

Example Usage

Stringurl = "url";
BooleanfetchContent = false;
BooleanignoreCertificateErrors = false;
Integertimeout = 20;
// Invoking the API call with sample inputswWW.uRLInfoAsync(url, fetchContent, ignoreCertificateErrors, timeout, newAPICallBack<URLInfoResponse>() {
publicvoidonSuccess(HttpContextcontext, URLInfoResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: hTMLCleanAsync

Clean and sanitize untrusted HTML. See: https://www.neutrinoapi.com/api/html-clean/

voidhTMLCleanAsync(
finalStringcontent,
finalStringoutputType,
finalAPICallBack<InputStream> callBack)

Parameters

ParameterTagsDescription
contentRequiredThe HTML content. This can be either a URL to load HTML from or an actual HTML content string
outputTypeRequiredThe level of sanitization, possible values are: plain-text: reduce the content to plain text only (no HTML tags at all) simple-text: allow only very basic text formatting tags like b, em, i, strong, u basic-html: allow advanced text formatting and hyper links basic-html-with-images: same as basic html but also allows image tags advanced-html: same as basic html with images but also allows many more common HTML tags like table, ul, dl, pre

Example Usage

Stringcontent = "content";
StringoutputType = "output-type";
// Invoking the API call with sample inputswWW.hTMLCleanAsync(content, outputType, newAPICallBack<InputStream>() {
publicvoidonSuccess(HttpContextcontext, InputStreamresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Method: browserBotAsync

Browser bot can extract content, interact with keyboard and mouse events, and execute JavaScript on a website. See: https://www.neutrinoapi.com/api/browser-bot/

voidbrowserBotAsync(
finalStringurl,
finalIntegertimeout,
finalIntegerdelay,
finalStringselector,
finalList<String> exec,
finalStringuserAgent,
finalBooleanignoreCertificateErrors,
finalAPICallBack<BrowserBotResponse> callBack)

Parameters

ParameterTagsDescription
urlRequiredThe URL to load
timeoutOptionalDefaultValueTimeout in seconds. Give up if still trying to load the page after this number of seconds
delayOptionalDefaultValueDelay in seconds to wait before capturing any page data, executing selectors or JavaScript
selectorOptionalExtract content from the page DOM using this selector. Commonly known as a CSS selector, you can find a good reference here
execOptionalCollectionExecute JavaScript on the page. Each array element should contain a valid JavaScript statement in string form. If a statement returns any kind of value it will be returned in the 'exec-results' response. For your convenience you can also use the following special shortcut functions:
sleep(seconds); Just wait/sleep for the specified number of seconds. click('selector'); Click on the first element matching the given selector. focus('selector'); Focus on the first element matching the given selector. keys('characters'); Send the specified keyboard characters. Use click() or focus() first to send keys to a specific element. enter(); Send the Enter key. tab(); Send the Tab key.
Example:
[ "click('#button-id')", "sleep(1)", "click('.field-class')", "keys('1234')", "enter()" ]
userAgentOptionalOverride the browsers default user-agent string with this one
ignoreCertificateErrorsOptionalDefaultValueIgnore any TLS/SSL certificate errors and load the page anyway

Example Usage

Stringurl = "url";
Integertimeout = 30;
Integerdelay = 3;
Stringselector = "selector";
List<String> exec = newLinkedList<String>(Arrays.asList("exec"));
StringuserAgent = "user-agent";
BooleanignoreCertificateErrors = false;
// Invoking the API call with sample inputswWW.browserBotAsync(url, timeout, delay, selector, exec, userAgent, ignoreCertificateErrors, newAPICallBack<BrowserBotResponse>() {
publicvoidonSuccess(HttpContextcontext, BrowserBotResponseresponse) {
// TODO success callback handler
}
publicvoidonFailure(HttpContextcontext, Throwableerror) {
// TODO failure callback handler
}
});

Back to List of Controllers

About

Neutrino API SDK - An eclipse and maven based java library project, which can be used with JRE7

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages