GoREST API Documentation

Posts

deletePost

Delete request to delete a post

Use this method to delete a post


/posts{id}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json,application/xml"\
"https://virtserver.swaggerhub.com/B24979/APIDocumention/1.0.0/posts{id}?user_id=&title=&body="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PostsApi;

import java.io.File;
import java.util.*;

public class PostsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        PostsApi apiInstance = new PostsApi();
        Integer id = 56; // Integer | id of the post
        Integer userId = 56; // Integer | id of the user
        String title = title_example; // String | title of post
        String body = body_example; // String | body of post
        try {
            Posts result = apiInstance.deletePost(id, userId, title, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PostsApi#deletePost");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PostsApi;

public class PostsApiExample {

    public static void main(String[] args) {
        PostsApi apiInstance = new PostsApi();
        Integer id = 56; // Integer | id of the post
        Integer userId = 56; // Integer | id of the user
        String title = title_example; // String | title of post
        String body = body_example; // String | body of post
        try {
            Posts result = apiInstance.deletePost(id, userId, title, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PostsApi#deletePost");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Integer *id = 56; // id of the post
Integer *userId = 56; // id of the user
String *title = title_example; // title of post
String *body = body_example; // body of post

PostsApi *apiInstance = [[PostsApi alloc] init];

// Delete request to delete a post
[apiInstance deletePostWith:id
    userId:userId
    title:title
    body:body
              completionHandler: ^(Posts output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var GoRestApiDocumentation = require('go_rest_api_documentation');
var defaultClient = GoRestApiDocumentation.ApiClient.instance;


var api = new GoRestApiDocumentation.PostsApi()
var id = 56; // {{Integer}} id of the post
var userId = 56; // {{Integer}} id of the user
var title = title_example; // {{String}} title of post
var body = body_example; // {{String}} body of post

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.deletePost(id, userId, title, body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deletePostExample
    {
        public void main()
        {


            var apiInstance = new PostsApi();
            var id = 56;  // Integer | id of the post
            var userId = 56;  // Integer | id of the user
            var title = title_example;  // String | title of post
            var body = body_example;  // String | body of post

            try
            {
                // Delete request to delete a post
                Posts result = apiInstance.deletePost(id, userId, title, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PostsApi.deletePost: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiPostsApi();
$id = 56; // Integer | id of the post
$userId = 56; // Integer | id of the user
$title = title_example; // String | title of post
$body = body_example; // String | body of post

try {
    $result = $api_instance->deletePost($id, $userId, $title, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostsApi->deletePost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PostsApi;


my $api_instance = WWW::SwaggerClient::PostsApi->new();
my $id = 56; # Integer | id of the post
my $userId = 56; # Integer | id of the user
my $title = title_example; # String | title of post
my $body = body_example; # String | body of post

eval { 
    my $result = $api_instance->deletePost(id => $id, userId => $userId, title => $title, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PostsApi->deletePost: $@\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.PostsApi()
id = 56 # Integer | id of the post
userId = 56 # Integer | id of the user
title = title_example # String | title of post
body = body_example # String | body of post

try: 
    # Delete request to delete a post
    api_response = api_instance.delete_post(id, userId, title, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PostsApi->deletePost: %s\n" % e)

Parameters

Path parameters
Name Description
id*
Integer
id of the post
Required
Query parameters
Name Description
user_id*
Integer
id of the user
Required
title*
String
title of post
Required
body*
String
body of post
Required

Responses

Status: 200 - Successful operation

Status: 400 - Not found


deletePostUserId

Delete request to delete a specific post by user id

Use this method to delete a specific post by user id


/posts/{user_id}

Usage and SDK Samples

curl -X DELETE\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json,application/xml"\
"https://virtserver.swaggerhub.com/B24979/APIDocumention/1.0.0/posts/{user_id}?id=&title=&body="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PostsApi;

import java.io.File;
import java.util.*;

public class PostsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        PostsApi apiInstance = new PostsApi();
        Integer userId = 56; // Integer | User id needed to delete post
        Integer id = 56; // Integer | id of post
        String title = title_example; // String | title of post
        String body = body_example; // String | body of post
        try {
            Posts result = apiInstance.deletePostUserId(userId, id, title, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PostsApi#deletePostUserId");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PostsApi;

public class PostsApiExample {

    public static void main(String[] args) {
        PostsApi apiInstance = new PostsApi();
        Integer userId = 56; // Integer | User id needed to delete post
        Integer id = 56; // Integer | id of post
        String title = title_example; // String | title of post
        String body = body_example; // String | body of post
        try {
            Posts result = apiInstance.deletePostUserId(userId, id, title, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PostsApi#deletePostUserId");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Integer *userId = 56; // User id needed to delete post
Integer *id = 56; // id of post
String *title = title_example; // title of post
String *body = body_example; // body of post

PostsApi *apiInstance = [[PostsApi alloc] init];

// Delete request to delete a specific post by user id
[apiInstance deletePostUserIdWith:userId
    id:id
    title:title
    body:body
              completionHandler: ^(Posts output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var GoRestApiDocumentation = require('go_rest_api_documentation');
var defaultClient = GoRestApiDocumentation.ApiClient.instance;


var api = new GoRestApiDocumentation.PostsApi()
var userId = 56; // {{Integer}} User id needed to delete post
var id = 56; // {{Integer}} id of post
var title = title_example; // {{String}} title of post
var body = body_example; // {{String}} body of post

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.deletePostUserId(userId, id, title, body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deletePostUserIdExample
    {
        public void main()
        {


            var apiInstance = new PostsApi();
            var userId = 56;  // Integer | User id needed to delete post
            var id = 56;  // Integer | id of post
            var title = title_example;  // String | title of post
            var body = body_example;  // String | body of post

            try
            {
                // Delete request to delete a specific post by user id
                Posts result = apiInstance.deletePostUserId(userId, id, title, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PostsApi.deletePostUserId: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiPostsApi();
$userId = 56; // Integer | User id needed to delete post
$id = 56; // Integer | id of post
$title = title_example; // String | title of post
$body = body_example; // String | body of post

try {
    $result = $api_instance->deletePostUserId($userId, $id, $title, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostsApi->deletePostUserId: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PostsApi;


my $api_instance = WWW::SwaggerClient::PostsApi->new();
my $userId = 56; # Integer | User id needed to delete post
my $id = 56; # Integer | id of post
my $title = title_example; # String | title of post
my $body = body_example; # String | body of post

eval { 
    my $result = $api_instance->deletePostUserId(userId => $userId, id => $id, title => $title, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PostsApi->deletePostUserId: $@\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.PostsApi()
userId = 56 # Integer | User id needed to delete post
id = 56 # Integer | id of post
title = title_example # String | title of post
body = body_example # String | body of post

try: 
    # Delete request to delete a specific post by user id
    api_response = api_instance.delete_post_user_id(userId, id, title, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PostsApi->deletePostUserId: %s\n" % e)

Parameters

Path parameters
Name Description
user_id*
Integer
User id needed to delete post
Required
Query parameters
Name Description
id*
Integer
id of post
Required
title*
String
title of post
Required
body*
String
body of post
Required

Responses

Status: 200 - Successful operation

Status: 400 - Not found


updatePost

Put request to update a post

Use this method to update a post


/posts{id}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json,application/xml"\
-H "Content-Type: application/json,application/xml"\
"https://virtserver.swaggerhub.com/B24979/APIDocumention/1.0.0/posts{id}?user_id=&title=&body="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PostsApi;

import java.io.File;
import java.util.*;

public class PostsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        PostsApi apiInstance = new PostsApi();
        Integer userId = 56; // Integer | id of the user
        String title = title_example; // String | title of post
        String body = body_example; // String | body of post
        Integer id = 56; // Integer | id of the post
        Posts body2 = ; // Posts | 
        try {
            Posts result = apiInstance.updatePost(userId, title, body, id, body2);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PostsApi#updatePost");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PostsApi;

public class PostsApiExample {

    public static void main(String[] args) {
        PostsApi apiInstance = new PostsApi();
        Integer userId = 56; // Integer | id of the user
        String title = title_example; // String | title of post
        String body = body_example; // String | body of post
        Integer id = 56; // Integer | id of the post
        Posts body2 = ; // Posts | 
        try {
            Posts result = apiInstance.updatePost(userId, title, body, id, body2);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PostsApi#updatePost");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Integer *userId = 56; // id of the user
String *title = title_example; // title of post
String *body = body_example; // body of post
Integer *id = 56; // id of the post
Posts *body2 = ; //  (optional)

PostsApi *apiInstance = [[PostsApi alloc] init];

// Put request to update a post
[apiInstance updatePostWith:userId
    title:title
    body:body
    id:id
    body2:body2
              completionHandler: ^(Posts output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var GoRestApiDocumentation = require('go_rest_api_documentation');
var defaultClient = GoRestApiDocumentation.ApiClient.instance;


var api = new GoRestApiDocumentation.PostsApi()
var userId = 56; // {{Integer}} id of the user
var title = title_example; // {{String}} title of post
var body = body_example; // {{String}} body of post
var id = 56; // {{Integer}} id of the post
var opts = { 
  'body2':  // {{Posts}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updatePost(userIdtitlebodyid, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updatePostExample
    {
        public void main()
        {


            var apiInstance = new PostsApi();
            var userId = 56;  // Integer | id of the user
            var title = title_example;  // String | title of post
            var body = body_example;  // String | body of post
            var id = 56;  // Integer | id of the post
            var body2 = new Posts(); // Posts |  (optional) 

            try
            {
                // Put request to update a post
                Posts result = apiInstance.updatePost(userId, title, body, id, body2);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PostsApi.updatePost: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiPostsApi();
$userId = 56; // Integer | id of the user
$title = title_example; // String | title of post
$body = body_example; // String | body of post
$id = 56; // Integer | id of the post
$body2 = ; // Posts | 

try {
    $result = $api_instance->updatePost($userId, $title, $body, $id, $body2);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostsApi->updatePost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PostsApi;


my $api_instance = WWW::SwaggerClient::PostsApi->new();
my $userId = 56; # Integer | id of the user
my $title = title_example; # String | title of post
my $body = body_example; # String | body of post
my $id = 56; # Integer | id of the post
my $body2 = WWW::SwaggerClient::Object::Posts->new(); # Posts | 

eval { 
    my $result = $api_instance->updatePost(userId => $userId, title => $title, body => $body, id => $id, body2 => $body2);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PostsApi->updatePost: $@\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.PostsApi()
userId = 56 # Integer | id of the user
title = title_example # String | title of post
body = body_example # String | body of post
id = 56 # Integer | id of the post
body2 =  # Posts |  (optional)

try: 
    # Put request to update a post
    api_response = api_instance.update_post(userId, title, body, id, body2=body2)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PostsApi->updatePost: %s\n" % e)

Parameters

Path parameters
Name Description
id*
Integer
id of the post
Required
Body parameters
Name Description
body
Query parameters
Name Description
user_id*
Integer
id of the user
Required
title*
String
title of post
Required
body*
String
body of post
Required

Responses

Status: 200 - Successful operation

Status: 400 - Not found


updatePostUserId

Put request to update a specific post by user id

Use this method to update a specific post by user id


/posts/{user_id}

Usage and SDK Samples

curl -X PUT\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json,application/xml"\
-H "Content-Type: application/json,application/xml"\
"https://virtserver.swaggerhub.com/B24979/APIDocumention/1.0.0/posts/{user_id}?id=&title=&body="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PostsApi;

import java.io.File;
import java.util.*;

public class PostsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        PostsApi apiInstance = new PostsApi();
        Integer id = 56; // Integer | id of post
        String title = title_example; // String | title of post
        String body = body_example; // String | body of post
        Integer userId = 56; // Integer | The user_id needed to update a post
        Posts body2 = ; // Posts | 
        try {
            Posts result = apiInstance.updatePostUserId(id, title, body, userId, body2);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PostsApi#updatePostUserId");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PostsApi;

public class PostsApiExample {

    public static void main(String[] args) {
        PostsApi apiInstance = new PostsApi();
        Integer id = 56; // Integer | id of post
        String title = title_example; // String | title of post
        String body = body_example; // String | body of post
        Integer userId = 56; // Integer | The user_id needed to update a post
        Posts body2 = ; // Posts | 
        try {
            Posts result = apiInstance.updatePostUserId(id, title, body, userId, body2);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PostsApi#updatePostUserId");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
Integer *id = 56; // id of post
String *title = title_example; // title of post
String *body = body_example; // body of post
Integer *userId = 56; // The user_id needed to update a post
Posts *body2 = ; //  (optional)

PostsApi *apiInstance = [[PostsApi alloc] init];

// Put request to update a specific post by user id
[apiInstance updatePostUserIdWith:id
    title:title
    body:body
    userId:userId
    body2:body2
              completionHandler: ^(Posts output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var GoRestApiDocumentation = require('go_rest_api_documentation');
var defaultClient = GoRestApiDocumentation.ApiClient.instance;


var api = new GoRestApiDocumentation.PostsApi()
var id = 56; // {{Integer}} id of post
var title = title_example; // {{String}} title of post
var body = body_example; // {{String}} body of post
var userId = 56; // {{Integer}} The user_id needed to update a post
var opts = { 
  'body2':  // {{Posts}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updatePostUserId(idtitlebodyuserId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updatePostUserIdExample
    {
        public void main()
        {


            var apiInstance = new PostsApi();
            var id = 56;  // Integer | id of post
            var title = title_example;  // String | title of post
            var body = body_example;  // String | body of post
            var userId = 56;  // Integer | The user_id needed to update a post
            var body2 = new Posts(); // Posts |  (optional) 

            try
            {
                // Put request to update a specific post by user id
                Posts result = apiInstance.updatePostUserId(id, title, body, userId, body2);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PostsApi.updatePostUserId: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiPostsApi();
$id = 56; // Integer | id of post
$title = title_example; // String | title of post
$body = body_example; // String | body of post
$userId = 56; // Integer | The user_id needed to update a post
$body2 = ; // Posts | 

try {
    $result = $api_instance->updatePostUserId($id, $title, $body, $userId, $body2);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostsApi->updatePostUserId: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PostsApi;


my $api_instance = WWW::SwaggerClient::PostsApi->new();
my $id = 56; # Integer | id of post
my $title = title_example; # String | title of post
my $body = body_example; # String | body of post
my $userId = 56; # Integer | The user_id needed to update a post
my $body2 = WWW::SwaggerClient::Object::Posts->new(); # Posts | 

eval { 
    my $result = $api_instance->updatePostUserId(id => $id, title => $title, body => $body, userId => $userId, body2 => $body2);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PostsApi->updatePostUserId: $@\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.PostsApi()
id = 56 # Integer | id of post
title = title_example # String | title of post
body = body_example # String | body of post
userId = 56 # Integer | The user_id needed to update a post
body2 =  # Posts |  (optional)

try: 
    # Put request to update a specific post by user id
    api_response = api_instance.update_post_user_id(id, title, body, userId, body2=body2)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PostsApi->updatePostUserId: %s\n" % e)

Parameters

Path parameters
Name Description
user_id*
Integer
The user_id needed to update a post
Required
Body parameters
Name Description
body
Query parameters
Name Description
id*
Integer
id of post
Required
title*
String
title of post
Required
body*
String
body of post
Required

Responses

Status: 200 - Successful operation

Status: 400 - Not found