RD_CreateTicket
7
March 2017
Rivendell C Library Manual

# rd_createticket

Rivendell Create Ticket C Library Function
Todd
Baker
bakert@rfa.org
Rivendell C Library Author

        #include <rivwebcapi/rd_createticket.h>

        int RD_CreateTicket
           struct rd_ticketinfo * ticketinfo[]
          const char hostname[]
          const char username[]
          const char passwd[]
          const char user_agent[]
          unsigned * numrecs

## Description

`RD_CreateTicket` is the function to use to create a Authentification Ticket within the Rivendell Database.

### RD_CreateTicket function call fields

FIELD NAME | FIELD TYPE | MEANING | REMARKS
--- | --- | --- | ---
*rd_audioinfo | Pointer to rd_ticketinfo structure | Memory location to store specific ticketinfo data | Mandatory
hostname | Character Array | Name Of Rivendell DB Host | Mandatory
username | Character Array | Rivendell User Name | Mandatory
passwd | Character Array | Rivendell User Password | Mandatory
user_agent | Character Array | User Agent Value put into HTTP request | Optional (default is Rivendell-C-API/x.x.x)
*numrecs | pointer to integer | memory location for number of records returned | Mandatory

When successful function will return the number of records sent (numrecs) and a rd_ticketinfo structure which is stored in the provided memory locations. The rd_ticketinfo structure has the following fields:

        struct rd_ticketinfo {
             char ticket[40];
              struct tm tkt_expiration_datetime;
        }

## RETURN VALUE

On success, zero is returned. Using the provided parameters an rd_ticketinfo structure is returned and the number of records is returned.

If a server error occurs a -1 is returned. If a client error occurs a specific error number is returned.

## ERRORS

403 User Authentification Error.

nnn Unknown Error Occurred.