REST API‎ > ‎Registration‎ > ‎

Registration Status

 This method can be called to determine
  • if a network ID has been previously registered
  • if a network ID has been previously registered and is associated with a particular application


Method: POST

URI: /api/rest/registrant/{networkid}

Path parameter:
  • networkid  The network ID to check status on
Form parameters:
  • query Allowed values = "exists" or "related", the default, if not specified, is "exists".
  • appkey The application key of the client application.
Returns:
 OK(200) query=="exists"The registrant with the specified network ID exists 
 OK(200) query=="related"The registrant with the specified network ID exists and is associated with the application
 UNAUTHORIZED(401) The network ID exists but it not associated with the specified application
 NOT_FOUND(404) The network ID is not registered 
 BAD_REQUEST(400)  Invalid appkey

Response Format: JSON

Examples:

curl -d"query=exists&appkey=
1f1bbca5-b71f-4138-97b6-59fed80623bc" https://api.telesocial.com/api/rest/registrant/eric

Response body:

{"RegistrantResponse":{"message":"","status":200}}

curl -d"query=related&appkey=1f1bbca5-b71f-4138-97b6-59fed80623bc" https://api.telesocial.com/api/rest/registrant/100000504666070

Response body:

{"RegistrantResponse":{"message":"","status":401}}

PHP Examples

In this PHP example, a developer checks the status of a networkID and their application.

 

public function checkNetworkID($networkID, $related = true, $greetingID = '')
    {
        $query = new telesocialQuery('registrant', $networkID);
        $query->addApiKey();
        $query->add('query', ($related ? 'related' : 'exists'));
        if ($query->make())
        {
            if ($related && $query->response['status'] == 401)
            {
                return $this->createNetworkID($networkID, false, $greetingID);
            }

            return $query->response['status'] == 200;
        }
        return false;
    }