SsODNet

resolver

High level Name resolver

The resolver method is intended to people who need to identify the names of planetary objects (asteroid, dwarf-planet, planet, natural satellite, comet, space probes and junks, exoplanets), and to resolve them in sky coordinates. It is a high level API dedicated to normal users. Developers may prefer the low level Quaero REST API.

HTTP Request

If you are a software/solutions developer, you might want to include the SsODNet resolver service in your application. This can be done by using the Web service method, or by using the following HTTP request:
https://ssp.imcce.fr/webservices/ssodnet/api/resolver.php?[parameters]
where [parameters] is a list of parameters separated by the ampersand character (&):
ParameterDefinitionLimits or value
-name=<string> The designation of the target Ex.: Mars, 5, a:Pallas, 1999 TC36, p/halley
-mime=<string> Mime type of the results votable | html | text | json
(default is votable)
-ep=<string> Requested epoch, expressed in Julian period, ISO format, or formatted as an English textual datetime years 1000.0 to 3000.0, default is now
-maxrec=<int> Maximum number of Sso to retrieve n ≥ 1, default is 10
-ephem=<int> To request (=1) or not (=0) the equatorial coordinates of the target at epoch 1 or 0, default is 0
-coord=<string> To request 2D equatorial coordinates (RA,DEC), or 3D (RA,DEC,Dobs) where Dobs is the distance to the observer 2D or 3D, default is 2D
-from=<string> Word that defines the name of the calling application, or that describes the request any short string (no space character)

The output parameters are described below. The output formats are VOTable (default), HTML, plain text format, and JSON. Only argument -name is mandatory.

Web service

The SsODNet Web service provides methods based on SOAP and HTTP POST verb which allow the interaction between an application and the SsODNet service. Information to invoke the SsODNet resolver method:
Web Service URI:
https://ssp.imcce.fr/webservices/ssodnet/ssodnet.php
Namespace:
https://ssp.imcce.fr/webservices/ssodnet
WSDL:
https://ssp.imcce.fr/webservices/ssodnet/ssodnet.php?wsdl
SOAP header:
name of the SOAP header element: clientID
SOAP header's content: array('from' => 'YourName', 'hostip'=>'')
Method:
resolver (inputArray)
The input parameter of the method is an array which must contained the following parameters:
VariableTypeUnitsLimits or valuesDefaultComment
name string designation - none Designation of the target
mime string - votable | html | text | json votable Mime type of the results
epoch string epoch years 1000.0 to 3000.0 now Requested epoch (julian period, ISO format, English textual datetime)
maxrec int - n ≥ 1 10 Maximum number of Sso to retrieve
ephem int - 0 | 1 0 To request (=1) or not (=0) the equatorial coordinates of the target at epoch
coord string - 2D | 3D 2D To request 2D equatorial coordinates (RA,DEC), or 3D (RA,DEC,Dobs) where Dobs is the distance to the observer

The output of the resolver method is an object containing the following attributes:

'flag'
Status of the response: flag=1 means ok; flag=0 or flag=-1 mean that an error occured
'status'
HTTP status-code of the response (e.g. 400: bad request, 422: Unprocessable Entity, 500: internal error)
'ticket'
Unix timestamp of the response which can be useful to stamp the request
'result'
String containing the ephemeris of the requested solar system body with parameters depending on user's options (cf. Output parameters section).
Depending on the selected mime type, the output is formatted as:
votable
Data are written in the IVOA standard VOTable format
html
Data are transformed from VOTable to HTML by XSLT processing (SsODNet XSL style sheet)
text
Data are returned in plain text where each block of data is separated by the semi-colon character ';' and each value in a block is separated by the pipe '|' character
json
Data are written in a JSON object.

Query examples

Output parameters

The output parameters of the resolver method are described in the following table.

Col. Definition Format Description
1 id String Unique identifier in the SsODNet.quaero database
2 type String Type of the Sso (Asteroid | Comet | Dwarf Planet | Exoplanet | Planet | Satellite | Spacecraft | Spacejunk)
3 class String Class of the Sso
4 name String Official or usual name of the Sso
5 number String Official or usual number of the Sso, null if the object is unnumbered
6 aliases String Comma separated list of all the aliases of the object
7 parent String Id of the parent of the Sso
8 system String Name of the planetary system to which the Sso belongs
If ephemerides are requested (ephem=1)
9 JD Float Epoch of the ephemeris (Julian day, UTC)
10 RA Float Geocentric astrometric J2000 right ascension of the Sso in degrees,
11 DEC Float Geocentric astrometric J2000 declination of the Sso in degrees
12 Dobs Float Distance to the observer (au), if coord=3D
13 referenceFrame String Reference plane of the ephemerides (equatorial)

Structure of the output JSON object

When the output mime type is the JSON data-interchange format, the data are encapsulated into a structure defined as follows:

{ "flag": int, "ticket": int, "version": string, "data": {} }

where data contains an array with all the SSOs that have been found:

"data": [ { "id": string, 
            "type": string,
            "class": string,
            "name": string,
            "number": int,
            "aliases": string,
            "parent": string,
            "system": string,
            "ephemeris": {} } ]

and where ephemeris contains the ephemerides of the target at the requested epoch:

"ephemeris": [ { "epoch": float, 
                 "ra": float,
                 "dec": float,
                 "dobs": float,
                 "referenceFrame": string } ]

How to consume

You have two ways to use the SsODNet web service: by writting a client to send requests to the SsODNet server and to receive and analyze the response, or by using a command line interface and a data transfert program such as curl or wget. For that, just execute one of the following commands in a console:
$> curl "<URL>"
or
$> wget "<URL>"
where <URL> is described in section HTTP request.

In order to help you to invoke the SsODNet Web service, we provide some clients written in differents languages. Here are some detailed explanations to write a client with PHP and SOAP which invokes the resolver method:

1/ Provide the input parameters which are mandatory for the service:

// Client's ID: provide the name of your project or organisation or yourself
$from = 'MyName';
// Input parameters
$param = array('name' => 'io',
               'mime' => "json",
               'epoch' => 'now',
               'maxrec' => 10,
               'ephem' => '1',
               'coord' => '2D'
);

2/ Define the SOAP options, the namespace and the WSDL URI of SsODNet web service:

// Enables or disables the WSDL caching feature
ini_set('soap.wsdl_cache_enabled', 1);
// SkyBoT namespace
$namespace = 'https://ssp.imcce.fr/webservices/ssodnet';
// SkyBoT WSDL
$uriwsdl = $namespace.'/ssodnet.wsdl';

3/ Create a SoapClient object in WSDL mode, set the SOAP header, then call the method and catch exceptions:

try {
   // Constructs the client
   $client = new SoapClient($uriwsdl, array('exceptions'=>1));
   // SOAP header
   $header = array('from'=>$from, 'hostip'=>'', 'lang'=>'en');
   $client->__setSoapHeaders(array(new SOAPHeader($namespace, 'clientID', $header)));  
   // Call the resolver method
   $response = $client->__soapCall('resolver',array($param));
   // Display the results
   if ($param['mime'] == 'text') {
      $res = explode(';', $response->result);
      $nbr = count($res);
      $newkey = array_keys($res);
      header("HTTP/1.0 ".$response->status);
      header("Content-Type: text/plain");
      echo "# Flag: ".$response->flag.PHP_EOL;
      echo "# Ticket: ".$response->ticket.PHP_EOL;
      for ($i=0; $i<$nbr; $i++) { echo $res[$newkey[$i]],PHP_EOL; }
   } else if ($param['mime'] == 'json') {
      header("HTTP/1.0 ".$response->status);
      header("Content-Type: application/json");
      echo $response->result;
   } else {
      header("HTTP/1.0 ".$response->status);
      header("Content-Type: text/xml;content=x-votable");
      echo $response->result;
   }
} catch (SoapFault $fault) {
   trigger_error("SOAP Fault: {$fault->getTraceAsString()} (faultcode: {$fault->faultcode}, 
                               faultstring: {$fault->faultstring})", E_USER_ERROR);
}