Overview

To start working you need to register in SocialAppsApi Telegram API Webservice from here, after registration and activating your account you will have an API Hash code, this Hash Code is your ID and in order to use Web service methods you will need the Hash Code.
After creating an account and getting the Hash Code you should add SocialAppsApi Telegram API Webservice's reference to your project.

Add SocialAppsApi Telegram API Webservice Reference to your project.

Webservice URL :
http://dc1telegramapi.socialappsapi.com/v1.asmx

How to Add a Reference to a Web Service in Microsoft Visual Studio (C#/VB.Net/ASP.Net)

XML Web Services, also known as ASMX services, were the predecessor of Windows Communication Foundation (WCF). You can access Web services by adding a service reference just as you would for any other WCF service. Any references added in this manner will target the latest version of the .NET Framework.
For applications that were created in an earlier version of Visual Studio, you can still add a Web reference that targets version 2.0 of the .NET Framework. To do this, follow the procedure that is described in the following section.

A Web reference should be added only if your application targets version 2.0 of the .NET Framework. To add a service reference that targets the current version of the .NET Framework, see How to: Add, Update, or Remove a Service Reference.

To add a Web reference to a project

  1. In Solution Explorer, right-click the name of the project that you want to add the service to, and then click Add Service Reference.

    The Add Service Reference dialog box appears.

  2. In the Add Service Reference dialog box, click the Advanced button.

    The Service Reference Settings dialog box appears.

  3. In the Service Reference Settings dialog box, click Add Web Reference.

    The Add Web Reference dialog box appears

  4. In the URL box, enter the URL of the Web service to use.
    http://dc1telegramapi.socialappsapi.com/v1.asmx

    If you are developing a Web application on a computer that is behind a firewall, and your application will consume Web services from outside the firewall, you must include the address and port of your network's proxy server in the URL. Ask your network administrator to furnish this part of the URL path. For more information, see The proxy settings on this computer are not configured correctly for Web discovery..

  5. In the Web services found at this URL box, select the Web service to use.

  6. Verify that your project can use the Web service, and that any external code provided is trustworthy.

    When you open a project for editing that includes a Web reference, a local proxy file for the Web service consumed runs in a process of Devenv.exe started by a trusted user, yourself. Opening projects or components in the integrated development environment (IDE) can execute code on the local computer. For more information, see Code Access Security.

  7. In the Web reference name field, enter a name that you will use in your code to access the selected Web service programmatically.

    By default, Web references are assigned a namespace that corresponds to their server name. You can change this value and enter a custom namespace name. There are some limitations on acceptable namespace names. For more information about characters that are not allowed in a Web reference name, see Add Web Reference Dialog Box. A namespace based on the Web reference name is created by building a nested folder hierarchy. Inside the innermost folder, a .wsdl file that references the Web service is created, together with supporting files, such as discovery (.disco and .discomap) files, that include information about where the Web service is located.

  8. Click Add Reference.

    If your project site does not already have one, Visual Studio creates a WebReferences folder. It then creates files that are required for the proxy class using the name that you provided in step 7.

How to Add a Reference to a Web Service in Embarcadero RAD Studio (Delphi/C++ Builder)

File > New > Other > Delphi Projects or C++Builder Projects > WebServices > WSDL Importer

The WSDL importer invoked from File > New > Other requires that you create an application before you can activate the command, but the WSDL importer invoked from the Component menu allows you to run the wizard before you create an application.

Use this wizard to import a WSDL document or XML schema that describes a Web Service. Once you have imported the WSDL document or XML schema, the wizard generates all the interface and class definitions you need for calling on those Web Services using a remote interfaced object (THTTPRIO). You can also tell the wizard to generate skeletal code that you can complete to create a Web Service application (for example, if you want to implement a Web Service that is already defined in a WSDL document).

Language page
If you do not have a project opened when you invoke the wizard, an initial Language page is displayed. On this page, you specify whether the generated bindings are for:

  • Delphi
  • C/C++

WSDL Location page
Allows specifying the URL of the WSDL document to import (or select an already stored one) and indicating the credentials (username, password, and a proxy) used to access the document.

Item Description
Location of WSDL File or URL Enter the URL of the Web service to use.
http://dc1telegramapi.socialappsapi.com/v1.asmx?wsdl
User Name leave blank
Password leave blank
Proxy Specify the host names for any proxy servers that must forward requests to the URL specified on the Source page of the Web Services Import dialog.

SOAP Version page
Allows you to either specify the SOAP version (1.1 or 1.2) that is used by the WSDL document or allow the product to choose the latest version available. Note that a service can support both 1.1 and 1.2. To avoid a mismatched version (which can cause the generation of incorrect source code), you should typically select the Automatic SOAP versioning option.

WSDL Import Options page
Use this wizard page to configure the way the wizard generates code to represent definitions in a WSDL document. Select any of the options described below. You should typically use the default options, because the defaults provide the safest way to import WSDL documents.
Click Finish on the WSDL Import Options page to proceed to source code generation.

    How to Call a Web Service in PHP
    How to Call a Web Service in JavaScript

After adding the corresponding reference to your project you can send messages in Telegram by the methods in the Web service.
To send your messages over the Telegram network you need to add a number of lines as the message sender to your account. This can be done by methods RegisterNewLineValidationCodeRequest and RegisterNewLineValidationCodeConfirmation.

The messages sender line is the mobile number through which the messages are sent. In Telegram each line has limitations to send message for example you cannot send your message to more than 30 different receivers every 24 hours and in case of sending more messages your line will be blocked by Telegram.
You can also use virtual lines, two of the providers of virtual lines include : http://receivesmsonline.com and http://www.getsmscode.com
You can also download and install this software to receive automatically virtual line services.

After registering your lines you can use a variety of methods to send messages to your recipients.
Click here to see the list of methods and their descriptions.

If you have questions or suggestions, you can contact us via the ticketing system or support mail.

Copyright © 2007 – 2015 Devesprit Ltd. All rights reserved.
SocialAppsApi.com | Help Center | Contact us