createGame
Create a game session
This endpoint create a game in the server, the username passed as parametter is set as the game owner
/api/v1/createGame
Usage and SDK Samples
curl -X POST\
-H "Accept: application/json,text/plain; charset=utf-8"\
-H "Content-Type: application/json"\
"truthInquiry.simailadjalim.fr/api/v1/createGame"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ApiApi;
import java.io.File;
import java.util.*;
public class ApiApiExample {
public static void main(String[] args) {
ApiApi apiInstance = new ApiApi();
V1_createGame_body body = ; // V1_createGame_body | username to set as game owner
try {
newGameData result = apiInstance.createGame(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApiApi#createGame");
e.printStackTrace();
}
}
}
import io.swagger.client.api.ApiApi;
public class ApiApiExample {
public static void main(String[] args) {
ApiApi apiInstance = new ApiApi();
V1_createGame_body body = ; // V1_createGame_body | username to set as game owner
try {
newGameData result = apiInstance.createGame(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApiApi#createGame");
e.printStackTrace();
}
}
}
V1_createGame_body *body = ; // username to set as game owner
ApiApi *apiInstance = [[ApiApi alloc] init];
// Create a game session
[apiInstance createGameWith:body
completionHandler: ^(newGameData output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var TruthInquiry = require('truth_inquiry');
var api = new TruthInquiry.ApiApi()
var body = ; // {{V1_createGame_body}} username to set as game owner
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createGame(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class createGameExample
{
public void main()
{
var apiInstance = new ApiApi();
var body = new V1_createGame_body(); // V1_createGame_body | username to set as game owner
try
{
// Create a game session
newGameData result = apiInstance.createGame(body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling ApiApi.createGame: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiApiApi();
$body = ; // V1_createGame_body | username to set as game owner
try {
$result = $api_instance->createGame($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ApiApi->createGame: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ApiApi;
my $api_instance = WWW::SwaggerClient::ApiApi->new();
my $body = WWW::SwaggerClient::Object::V1_createGame_body->new(); # V1_createGame_body | username to set as game owner
eval {
my $result = $api_instance->createGame(body => $body);
print Dumper($result);
};
if ($@) {
warn "Exception when calling ApiApi->createGame: $@\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.ApiApi()
body = # V1_createGame_body | username to set as game owner
try:
# Create a game session
api_response = api_instance.create_game(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ApiApi->createGame: %s\n" % e)
Parameters
Name | Description |
---|---|
body * |