getPost
returns post with the given id
returns information about the post username and post text are URI Encoded
/api/getPost
Usage and SDK Samples
curl -X GET\
-H "Accept: application/json"\
"https://ipost.tk/api/getPost?id="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CORSApi;
import java.io.File;
import java.util.*;
public class CORSApiExample {
public static void main(String[] args) {
CORSApi apiInstance = new CORSApi();
BigDecimal id = 1.2; // BigDecimal | the id of the post
try {
inline_response_200_3 result = apiInstance.getPost(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CORSApi#getPost");
e.printStackTrace();
}
}
}
import io.swagger.client.api.CORSApi;
public class CORSApiExample {
public static void main(String[] args) {
CORSApi apiInstance = new CORSApi();
BigDecimal id = 1.2; // BigDecimal | the id of the post
try {
inline_response_200_3 result = apiInstance.getPost(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CORSApi#getPost");
e.printStackTrace();
}
}
}
BigDecimal *id = 1.2; // the id of the post
CORSApi *apiInstance = [[CORSApi alloc] init];
// returns post with the given id
[apiInstance getPostWith:id
completionHandler: ^(inline_response_200_3 output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var SimplePostsaccountApi = require('simple_postsaccount_api');
var api = new SimplePostsaccountApi.CORSApi()
var id = 1.2; // {{BigDecimal}} the id of the post
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getPost(id, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getPostExample
{
public void main()
{
var apiInstance = new CORSApi();
var id = 1.2; // BigDecimal | the id of the post
try
{
// returns post with the given id
inline_response_200_3 result = apiInstance.getPost(id);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling CORSApi.getPost: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiCORSApi();
$id = 1.2; // BigDecimal | the id of the post
try {
$result = $api_instance->getPost($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CORSApi->getPost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CORSApi;
my $api_instance = WWW::SwaggerClient::CORSApi->new();
my $id = 1.2; # BigDecimal | the id of the post
eval {
my $result = $api_instance->getPost(id => $id);
print Dumper($result);
};
if ($@) {
warn "Exception when calling CORSApi->getPost: $@\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.CORSApi()
id = 1.2 # BigDecimal | the id of the post
try:
# returns post with the given id
api_response = api_instance.get_post(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling CORSApi->getPost: %s\n" % e)
Parameters
Name | Description |
---|---|
id* |
BigDecimal
the id of the post
Required
|