createAccount
Use this method to create a new Telegraph account. Most users only need one account, but this can be useful for channel administrators who would like to keep individual author names and profile links for each of their channels. On success, returns an Account object with the regular fields and an additional access_token field.
/createAccount
Usage and SDK Samples
curl -X GET "https://api.apieco.ir/telegraph/createAccount?short_name=&author_name=&author_url="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CreateAccountApi;
import java.io.File;
import java.util.*;
public class CreateAccountApiExample {
public static void main(String[] args) {
CreateAccountApi apiInstance = new CreateAccountApi();
String apiecoKey = apiecoKey_example; // String |
String shortName = shortName_example; // String | Required. Account name, helps users with several accounts remember which they are currently using. Displayed to the user above the "Edit/Publish" button on Telegra.ph, other users don't see this name.
String authorName = authorName_example; // String | Default author name used when creating new articles.
String authorUrl = authorUrl_example; // String | Default profile link, opened when users click on the author's name below the title. Can be any link, not necessarily to a Telegram profile or channel.
try {
inline_response_200 result = apiInstance.createAccount(apiecoKey, shortName, authorName, authorUrl);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CreateAccountApi#createAccount");
e.printStackTrace();
}
}
}
import io.swagger.client.api.CreateAccountApi;
public class CreateAccountApiExample {
public static void main(String[] args) {
CreateAccountApi apiInstance = new CreateAccountApi();
String apiecoKey = apiecoKey_example; // String |
String shortName = shortName_example; // String | Required. Account name, helps users with several accounts remember which they are currently using. Displayed to the user above the "Edit/Publish" button on Telegra.ph, other users don't see this name.
String authorName = authorName_example; // String | Default author name used when creating new articles.
String authorUrl = authorUrl_example; // String | Default profile link, opened when users click on the author's name below the title. Can be any link, not necessarily to a Telegram profile or channel.
try {
inline_response_200 result = apiInstance.createAccount(apiecoKey, shortName, authorName, authorUrl);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CreateAccountApi#createAccount");
e.printStackTrace();
}
}
}
String *apiecoKey = apiecoKey_example; //
String *shortName = shortName_example; // Required. Account name, helps users with several accounts remember which they are currently using. Displayed to the user above the "Edit/Publish" button on Telegra.ph, other users don't see this name.
String *authorName = authorName_example; // Default author name used when creating new articles. (optional)
String *authorUrl = authorUrl_example; // Default profile link, opened when users click on the author's name below the title. Can be any link, not necessarily to a Telegram profile or channel. (optional)
CreateAccountApi *apiInstance = [[CreateAccountApi alloc] init];
[apiInstance createAccountWith:apiecoKey
shortName:shortName
authorName:authorName
authorUrl:authorUrl
completionHandler: ^(inline_response_200 output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var FinancialTimesApiDocumentation = require('financial_times_api_documentation');
var api = new FinancialTimesApiDocumentation.CreateAccountApi()
var apiecoKey = apiecoKey_example; // {String}
var shortName = shortName_example; // {String} Required. Account name, helps users with several accounts remember which they are currently using. Displayed to the user above the "Edit/Publish" button on Telegra.ph, other users don't see this name.
var opts = {
'authorName': authorName_example, // {String} Default author name used when creating new articles.
'authorUrl': authorUrl_example // {String} Default profile link, opened when users click on the author's name below the title. Can be any link, not necessarily to a Telegram profile or channel.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createAccount(apiecoKey, shortName, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class createAccountExample
{
public void main()
{
var apiInstance = new CreateAccountApi();
var apiecoKey = apiecoKey_example; // String |
var shortName = shortName_example; // String | Required. Account name, helps users with several accounts remember which they are currently using. Displayed to the user above the "Edit/Publish" button on Telegra.ph, other users don't see this name.
var authorName = authorName_example; // String | Default author name used when creating new articles. (optional)
var authorUrl = authorUrl_example; // String | Default profile link, opened when users click on the author's name below the title. Can be any link, not necessarily to a Telegram profile or channel. (optional)
try
{
inline_response_200 result = apiInstance.createAccount(apiecoKey, shortName, authorName, authorUrl);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling CreateAccountApi.createAccount: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\CreateAccountApi();
$apiecoKey = apiecoKey_example; // String |
$shortName = shortName_example; // String | Required. Account name, helps users with several accounts remember which they are currently using. Displayed to the user above the "Edit/Publish" button on Telegra.ph, other users don't see this name.
$authorName = authorName_example; // String | Default author name used when creating new articles.
$authorUrl = authorUrl_example; // String | Default profile link, opened when users click on the author's name below the title. Can be any link, not necessarily to a Telegram profile or channel.
try {
$result = $api_instance->createAccount($apiecoKey, $shortName, $authorName, $authorUrl);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CreateAccountApi->createAccount: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CreateAccountApi;
my $api_instance = WWW::SwaggerClient::CreateAccountApi->new();
my $apiecoKey = apiecoKey_example; # String |
my $shortName = shortName_example; # String | Required. Account name, helps users with several accounts remember which they are currently using. Displayed to the user above the "Edit/Publish" button on Telegra.ph, other users don't see this name.
my $authorName = authorName_example; # String | Default author name used when creating new articles.
my $authorUrl = authorUrl_example; # String | Default profile link, opened when users click on the author's name below the title. Can be any link, not necessarily to a Telegram profile or channel.
eval {
my $result = $api_instance->createAccount(apiecoKey => $apiecoKey, shortName => $shortName, authorName => $authorName, authorUrl => $authorUrl);
print Dumper($result);
};
if ($@) {
warn "Exception when calling CreateAccountApi->createAccount: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.CreateAccountApi()
apiecoKey = apiecoKey_example # String |
shortName = shortName_example # String | Required. Account name, helps users with several accounts remember which they are currently using. Displayed to the user above the "Edit/Publish" button on Telegra.ph, other users don't see this name.
authorName = authorName_example # String | Default author name used when creating new articles. (optional)
authorUrl = authorUrl_example # String | Default profile link, opened when users click on the author's name below the title. Can be any link, not necessarily to a Telegram profile or channel. (optional)
try:
api_response = api_instance.create_account(apiecoKey, shortName, authorName=authorName, authorUrl=authorUrl)
pprint(api_response)
except ApiException as e:
print("Exception when calling CreateAccountApi->createAccount: %s\n" % e)
Parameters
Name | Description |
---|---|
apieco-key* |
String
Required
|
Name | Description |
---|---|
short_name* |
String
Required. Account name, helps users with several accounts remember which they are currently using. Displayed to the user above the "Edit/Publish" button on Telegra.ph, other users don't see this name.
Required
|
author_name | |
author_url |