[Tool/Web/Other] SA-MP OpenAPI - HTTP Tools.
#1

SA-MP OpenAPI
What is OpenAPI?

OpenAPI is a class based http query mechanism for utilization by SA-MP's http native. The class was created as a small project of mine that I thought would be highly useful for server owners whom don't have access to a host to upload there own API for use with there scripts.

Using OpenAPI

When using OpenAPI you supply your information to the system by means of using the $_GET system. Simply specify the parameters within the URL and the system will handle the rest.
1ST URL Parameter
This parameter is the crucial one that determines what function you are wishing to utilize. This parameter has 3 types as listed below.
  • TYPE_ENCRYPTION - This is the string encryption module.
  • TYPE_EMAILING - This is the client emailing module.
  • TYPE_IPHANDLE - This is the IP handling module.
Example of first parameter: openapi.x-host.co.uk/public_query.php?func=TYPE_IPHANDLE
2ND URL Parameter
This parameter is based upon the first parameter that you specified in the URL first. For example if you used the function type TYPE_ENCRYPTION before only a set amount of functions will work for that module.

TYPE_ENCRYPTION
  • ENCRYPT_MD5 - Returns the given string in MD5.
  • ENCRYPT_BASE64 - Returns the given string in Base64.
  • DECRYPT_BASE64 - Returns the given Base64 string in plain text.
TYPE_EMAILING
  • EMAIL_CLIENT - Returns a boolean based upon the success of emailing the specified client.
TYPE_IPHANDLE
  • IP_HOSTNAME - Returns the given IP addresses hostname in plain text.
Example of second parameter: openapi.x-host.co.uk/public_query.php?func=TYPE_ENCRYPTION&method=ENCRY PT_MD5
3RD URL Parameter

This parameter consists of the function parameters of the function you want to utilize. This can have a maximum of three parameters.
ENCRYPT_MD5
  • string - This is the string you want to hash to MD5.
  • Example: openapi.x-host.co.uk/public_query.php?func=TYPE_ENCRYPTION&method=ENCRY PT_MD5&string=Hello
ENCRYPT_BASE64
  • string - This is the string you want to encode to Base64.
  • Example: openapi.x-host.co.uk/public_query.php?func=TYPE_ENCRYPTION&method=ENCRY PT_BASE64&string=Hello
DECRYPT_BASE64
  • string - This is the string you want to decode to plan text from Base64.
  • Example: openapi.x-host.co.uk/public_query.php?func=TYPE_ENCRYPTION&method=DECRY PT_BASE64&string=SGVsbG8=
EMAIL_CLIENT
  • email_addr - This is the email address you wish to email.
  • email_subject - This is the subject of the email you wish to send.
  • email_message - This is the message you with to send.
  • Example: openapi.x-host.co.uk/public_query.php?func=TYPE_EMAILING&method=EMAIL_C LIENT&email_addr=example@example.com&email_subject =Hello&email_message=How are you doing there.
IP_HOSTNAME
  • ip_addr - This is the IP address that you with to obtain the hostname for.
  • Example: openapi.x-host.co.uk/public_query.php?func=TYPE_IPHANDLE&method=IP_HOST NAME&ip_addr=173.194.36.104
API URL: openapi.x-host.co.uk/public_query.php?
Reply
#2

Someone released a similar (yet more basic, email only) system which failed to include an anti-spam mechanism, resulting in the ability to exploit it. Have you implemented some form of anti-spam/abuse feature?

P.S: I need to rejoin your IRC channel sometime.
Reply
#3

Quote:
Originally Posted by Calgon
View Post
Someone released a similar (yet more basic, email only) system which failed to include an anti-spam mechanism, resulting in the ability to exploit it. Have you implemented some form of anti-spam/abuse feature?

P.S: I need to rejoin your IRC channel sometime.
I've integrated IP-Based monitoring so you can't send mass emails within a space of a hour etc. And sure you're welcome any time
Reply
#4

This is quite handy, if you ask me. I'm glad you implemented SOME sort of anti-spam. Good work dude.
Reply
#5

Quote:
Originally Posted by RealCop228
View Post
This is quite handy, if you ask me. I'm glad you implemented SOME sort of anti-spam. Good work dude.
Thanks for your positive input
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)