getAnswer
get answers
get all answers of questionareId by questionareId(通过任务id获取一个快递任务)
/task/answer/{questionareId}
Usage and SDK Samples
curl -X GET "https://petstore.swagger.io/task/answer/{questionareId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.TaskApi;
import java.io.File;
import java.util.*;
public class TaskApiExample {
public static void main(String[] args) {
TaskApi apiInstance = new TaskApi();
Integer questionareId = 56; // Integer | the id of questionare
try {
answers result = apiInstance.getAnswer(questionareId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TaskApi#getAnswer");
e.printStackTrace();
}
}
}
import io.swagger.client.api.TaskApi;
public class TaskApiExample {
public static void main(String[] args) {
TaskApi apiInstance = new TaskApi();
Integer questionareId = 56; // Integer | the id of questionare
try {
answers result = apiInstance.getAnswer(questionareId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TaskApi#getAnswer");
e.printStackTrace();
}
}
}
Integer *questionareId = 56; // the id of questionare
TaskApi *apiInstance = [[TaskApi alloc] init];
// get answers
[apiInstance getAnswerWith:questionareId
completionHandler: ^(answers output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var SwaggerJsClient = require('swagger-js-client');
var api = new SwaggerJsClient.TaskApi()
var questionareId = 56; // {Integer} the id of questionare
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getAnswer(questionareId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getAnswerExample
{
public void main()
{
var apiInstance = new TaskApi();
var questionareId = 56; // Integer | the id of questionare
try
{
// get answers
answers result = apiInstance.getAnswer(questionareId);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling TaskApi.getAnswer: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\TaskApi();
$questionareId = 56; // Integer | the id of questionare
try {
$result = $api_instance->getAnswer($questionareId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TaskApi->getAnswer: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::TaskApi;
my $api_instance = WWW::SwaggerClient::TaskApi->new();
my $questionareId = 56; # Integer | the id of questionare
eval {
my $result = $api_instance->getAnswer(questionareId => $questionareId);
print Dumper($result);
};
if ($@) {
warn "Exception when calling TaskApi->getAnswer: $@\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.TaskApi()
questionareId = 56 # Integer | the id of questionare
try:
# get answers
api_response = api_instance.get_answer(questionareId)
pprint(api_response)
except ApiException as e:
print("Exception when calling TaskApi->getAnswer: %s\n" % e)
Parameters
Name | Description |
---|---|
questionareId* |
Integer
the id of questionare
Required
|