Chuck Norris

Categories

jokesCategoriesGet

Retrieve a list of available joke categories.


/jokes/categories

Usage and SDK Samples

curl -X GET -H "apieco-key: [[apiKey]]" "https://api.apieco.ir/chucknorris/jokes/categories"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CategoriesApi;

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

public class CategoriesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: apieco-key
        ApiKeyAuth apieco-key = (ApiKeyAuth) defaultClient.getAuthentication("apieco-key");
        apieco-key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //apieco-key.setApiKeyPrefix("Token");

        CategoriesApi apiInstance = new CategoriesApi();
        String accept = accept_example; // String | Type of Response (Example= application/json)
        String apiecoKey = apiecoKey_example; // String | 
        try {
            category result = apiInstance.jokesCategoriesGet(accept, apiecoKey);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CategoriesApi#jokesCategoriesGet");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CategoriesApi;

public class CategoriesApiExample {

    public static void main(String[] args) {
        CategoriesApi apiInstance = new CategoriesApi();
        String accept = accept_example; // String | Type of Response (Example= application/json)
        String apiecoKey = apiecoKey_example; // String | 
        try {
            category result = apiInstance.jokesCategoriesGet(accept, apiecoKey);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CategoriesApi#jokesCategoriesGet");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: apieco-key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"apieco-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"apieco-key"];

String *accept = accept_example; // Type of Response (Example= application/json)
String *apiecoKey = apiecoKey_example; //  (optional)

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

//  Retrieve a list of available joke categories.



[apiInstance jokesCategoriesGetWith:accept
    apiecoKey:apiecoKey
              completionHandler: ^(category output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var ChuckNorris_ = require('chuck_norris_');
var defaultClient = ChuckNorris_.ApiClient.instance;

// Configure API key authorization: apieco-key
var apieco-key = defaultClient.authentications['apieco-key'];
apieco-key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apieco-key.apiKeyPrefix['apieco-key'] = "Token"

var api = new ChuckNorris_.CategoriesApi()

var accept = accept_example; // {String} Type of Response (Example= application/json)

var opts = { 
  'apiecoKey': apiecoKey_example // {String} 
};

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

namespace Example
{
    public class jokesCategoriesGetExample
    {
        public void main()
        {
            
            // Configure API key authorization: apieco-key
            Configuration.Default.ApiKey.Add("apieco-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("apieco-key", "Bearer");

            var apiInstance = new CategoriesApi();
            var accept = accept_example;  // String | Type of Response (Example= application/json)
            var apiecoKey = apiecoKey_example;  // String |  (optional) 

            try
            {
                //  Retrieve a list of available joke categories.



                category result = apiInstance.jokesCategoriesGet(accept, apiecoKey);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CategoriesApi.jokesCategoriesGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: apieco-key
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('apieco-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apieco-key', 'Bearer');

$api_instance = new Swagger\Client\Api\CategoriesApi();
$accept = accept_example; // String | Type of Response (Example= application/json)
$apiecoKey = apiecoKey_example; // String | 

try {
    $result = $api_instance->jokesCategoriesGet($accept, $apiecoKey);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CategoriesApi->jokesCategoriesGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CategoriesApi;

# Configure API key authorization: apieco-key
$WWW::SwaggerClient::Configuration::api_key->{'apieco-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'apieco-key'} = "Bearer";

my $api_instance = WWW::SwaggerClient::CategoriesApi->new();
my $accept = accept_example; # String | Type of Response (Example= application/json)
my $apiecoKey = apiecoKey_example; # String | 

eval { 
    my $result = $api_instance->jokesCategoriesGet(accept => $accept, apiecoKey => $apiecoKey);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CategoriesApi->jokesCategoriesGet: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apieco-key
swagger_client.configuration.api_key['apieco-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['apieco-key'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CategoriesApi()
accept = accept_example # String | Type of Response (Example= application/json)
apiecoKey = apiecoKey_example # String |  (optional)

try: 
    #  Retrieve a list of available joke categories.



    api_response = api_instance.jokes_categories_get(accept, apiecoKey=apiecoKey)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CategoriesApi->jokesCategoriesGet: %s\n" % e)

Parameters

Header parameters
Name Description
apieco-key
String
accept*
String
Type of Response (Example= application/json)
Required

Responses

Status: 200 - Succesfull

Status: 401 - wrong code

Status: 405 - Invalid input


jokesSearchGet

Free text search


/jokes/search

Usage and SDK Samples

curl -X GET -H "apieco-key: [[apiKey]]" "https://api.apieco.ir/chucknorris/jokes/search?query="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CategoriesApi;

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

public class CategoriesApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: apieco-key
        ApiKeyAuth apieco-key = (ApiKeyAuth) defaultClient.getAuthentication("apieco-key");
        apieco-key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //apieco-key.setApiKeyPrefix("Token");

        CategoriesApi apiInstance = new CategoriesApi();
        String accept = accept_example; // String | Type of Response (Example= application/json)
        String query = query_example; // String | The search term
        String apiecoKey = apiecoKey_example; // String | 
        try {
            search result = apiInstance.jokesSearchGet(accept, query, apiecoKey);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CategoriesApi#jokesSearchGet");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CategoriesApi;

public class CategoriesApiExample {

    public static void main(String[] args) {
        CategoriesApi apiInstance = new CategoriesApi();
        String accept = accept_example; // String | Type of Response (Example= application/json)
        String query = query_example; // String | The search term
        String apiecoKey = apiecoKey_example; // String | 
        try {
            search result = apiInstance.jokesSearchGet(accept, query, apiecoKey);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CategoriesApi#jokesSearchGet");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: apieco-key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"apieco-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"apieco-key"];

String *accept = accept_example; // Type of Response (Example= application/json)
String *query = query_example; // The search term
String *apiecoKey = apiecoKey_example; //  (optional)

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

//  Free text search



[apiInstance jokesSearchGetWith:accept
    query:query
    apiecoKey:apiecoKey
              completionHandler: ^(search output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var ChuckNorris_ = require('chuck_norris_');
var defaultClient = ChuckNorris_.ApiClient.instance;

// Configure API key authorization: apieco-key
var apieco-key = defaultClient.authentications['apieco-key'];
apieco-key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apieco-key.apiKeyPrefix['apieco-key'] = "Token"

var api = new ChuckNorris_.CategoriesApi()

var accept = accept_example; // {String} Type of Response (Example= application/json)

var query = query_example; // {String} The search term

var opts = { 
  'apiecoKey': apiecoKey_example // {String} 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.jokesSearchGet(accept, query, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class jokesSearchGetExample
    {
        public void main()
        {
            
            // Configure API key authorization: apieco-key
            Configuration.Default.ApiKey.Add("apieco-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("apieco-key", "Bearer");

            var apiInstance = new CategoriesApi();
            var accept = accept_example;  // String | Type of Response (Example= application/json)
            var query = query_example;  // String | The search term
            var apiecoKey = apiecoKey_example;  // String |  (optional) 

            try
            {
                //  Free text search



                search result = apiInstance.jokesSearchGet(accept, query, apiecoKey);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CategoriesApi.jokesSearchGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: apieco-key
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('apieco-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apieco-key', 'Bearer');

$api_instance = new Swagger\Client\Api\CategoriesApi();
$accept = accept_example; // String | Type of Response (Example= application/json)
$query = query_example; // String | The search term
$apiecoKey = apiecoKey_example; // String | 

try {
    $result = $api_instance->jokesSearchGet($accept, $query, $apiecoKey);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CategoriesApi->jokesSearchGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CategoriesApi;

# Configure API key authorization: apieco-key
$WWW::SwaggerClient::Configuration::api_key->{'apieco-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'apieco-key'} = "Bearer";

my $api_instance = WWW::SwaggerClient::CategoriesApi->new();
my $accept = accept_example; # String | Type of Response (Example= application/json)
my $query = query_example; # String | The search term
my $apiecoKey = apiecoKey_example; # String | 

eval { 
    my $result = $api_instance->jokesSearchGet(accept => $accept, query => $query, apiecoKey => $apiecoKey);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CategoriesApi->jokesSearchGet: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apieco-key
swagger_client.configuration.api_key['apieco-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['apieco-key'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.CategoriesApi()
accept = accept_example # String | Type of Response (Example= application/json)
query = query_example # String | The search term
apiecoKey = apiecoKey_example # String |  (optional)

try: 
    #  Free text search



    api_response = api_instance.jokes_search_get(accept, query, apiecoKey=apiecoKey)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CategoriesApi->jokesSearchGet: %s\n" % e)

Parameters

Header parameters
Name Description
apieco-key
String
accept*
String
Type of Response (Example= application/json)
Required
Query parameters
Name Description
query*
String
The search term
Required

Responses

Status: 200 - Succesfull

Status: 401 - wrong code

Status: 405 - Invalid input


Random

jokesRandomGet

The API will return a random joke.


/jokes/random

Usage and SDK Samples

curl -X GET -H "apieco-key: [[apiKey]]" "https://api.apieco.ir/chucknorris/jokes/random?category="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.RandomApi;

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

public class RandomApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: apieco-key
        ApiKeyAuth apieco-key = (ApiKeyAuth) defaultClient.getAuthentication("apieco-key");
        apieco-key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //apieco-key.setApiKeyPrefix("Token");

        RandomApi apiInstance = new RandomApi();
        String accept = accept_example; // String | Type of Response (Example= application/json)
        String apiecoKey = apiecoKey_example; // String | 
        String category = category_example; // String | Specifies the category of the random joke.
        try {
            joke result = apiInstance.jokesRandomGet(accept, apiecoKey, category);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling RandomApi#jokesRandomGet");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.RandomApi;

public class RandomApiExample {

    public static void main(String[] args) {
        RandomApi apiInstance = new RandomApi();
        String accept = accept_example; // String | Type of Response (Example= application/json)
        String apiecoKey = apiecoKey_example; // String | 
        String category = category_example; // String | Specifies the category of the random joke.
        try {
            joke result = apiInstance.jokesRandomGet(accept, apiecoKey, category);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling RandomApi#jokesRandomGet");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure API key authorization: (authentication scheme: apieco-key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"apieco-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"apieco-key"];

String *accept = accept_example; // Type of Response (Example= application/json)
String *apiecoKey = apiecoKey_example; //  (optional)
String *category = category_example; // Specifies the category of the random joke. (optional)

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

//  The API will return a random joke.



[apiInstance jokesRandomGetWith:accept
    apiecoKey:apiecoKey
    category:category
              completionHandler: ^(joke output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var ChuckNorris_ = require('chuck_norris_');
var defaultClient = ChuckNorris_.ApiClient.instance;

// Configure API key authorization: apieco-key
var apieco-key = defaultClient.authentications['apieco-key'];
apieco-key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apieco-key.apiKeyPrefix['apieco-key'] = "Token"

var api = new ChuckNorris_.RandomApi()

var accept = accept_example; // {String} Type of Response (Example= application/json)

var opts = { 
  'apiecoKey': apiecoKey_example, // {String} 
  'category': category_example // {String} Specifies the category of the random joke.
};

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

namespace Example
{
    public class jokesRandomGetExample
    {
        public void main()
        {
            
            // Configure API key authorization: apieco-key
            Configuration.Default.ApiKey.Add("apieco-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("apieco-key", "Bearer");

            var apiInstance = new RandomApi();
            var accept = accept_example;  // String | Type of Response (Example= application/json)
            var apiecoKey = apiecoKey_example;  // String |  (optional) 
            var category = category_example;  // String | Specifies the category of the random joke. (optional) 

            try
            {
                //  The API will return a random joke.



                joke result = apiInstance.jokesRandomGet(accept, apiecoKey, category);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling RandomApi.jokesRandomGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: apieco-key
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('apieco-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apieco-key', 'Bearer');

$api_instance = new Swagger\Client\Api\RandomApi();
$accept = accept_example; // String | Type of Response (Example= application/json)
$apiecoKey = apiecoKey_example; // String | 
$category = category_example; // String | Specifies the category of the random joke.

try {
    $result = $api_instance->jokesRandomGet($accept, $apiecoKey, $category);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RandomApi->jokesRandomGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::RandomApi;

# Configure API key authorization: apieco-key
$WWW::SwaggerClient::Configuration::api_key->{'apieco-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'apieco-key'} = "Bearer";

my $api_instance = WWW::SwaggerClient::RandomApi->new();
my $accept = accept_example; # String | Type of Response (Example= application/json)
my $apiecoKey = apiecoKey_example; # String | 
my $category = category_example; # String | Specifies the category of the random joke.

eval { 
    my $result = $api_instance->jokesRandomGet(accept => $accept, apiecoKey => $apiecoKey, category => $category);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling RandomApi->jokesRandomGet: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: apieco-key
swagger_client.configuration.api_key['apieco-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['apieco-key'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.RandomApi()
accept = accept_example # String | Type of Response (Example= application/json)
apiecoKey = apiecoKey_example # String |  (optional)
category = category_example # String | Specifies the category of the random joke. (optional)

try: 
    #  The API will return a random joke.



    api_response = api_instance.jokes_random_get(accept, apiecoKey=apiecoKey, category=category)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RandomApi->jokesRandomGet: %s\n" % e)

Parameters

Header parameters
Name Description
apieco-key
String
accept*
String
Type of Response (Example= application/json)
Required
Query parameters
Name Description
category
String
Specifies the category of the random joke.

Responses

Status: 200 - Succesfull

Status: 401 - wrong code

Status: 405 - Invalid input