RD_AssignSchedCode
7
October 2015
Rivendell C Library Manual

# rd_assignschedcode

Rivendell Assign Scheduler Code to Cart C Library Function
Todd
Baker
bakert@rfa.org
Rivendell C Library Author

        #include <rivwebcapi/rd_assignschedcode.h>

        int RD_AssignSchedCode
          const char hostname[]
          const char username[]
          const char passwd[]
          const char ticket[]
          const unsigned cartnumber
          const char code[]
          const char user_agent[]

## Description

`RD_AssignSchedCode` is the function to use to assign a Scheduler Code to a cart in the Rivendell database.

### RD_AssignSchedCode function call fields

FIELD NAME | FIELD TYPE | MEANING | REMARKS
--- | --- | --- | ---
hostname | Character Array | Name Of Rivendell DB Host | Mandatory
username | Character Array | Rivendell User Name | Mandatory When NO Ticket Provided
passwd | Character Array | Rivendell User Password | Mandatory When NO Ticket Provided
ticket | Character Array | Rivendell Authentification Ticket | Mandatory When NO User/Password Pair Provided.
cartnumber | unsigned integer | Cart Number | Mandatory
code | Character Array | Scheduler Code to Assign | Mandatory
user_agent | Character Array | User Agent Value put into HTTP request | Optional (default is Rivendell-C-API/x.x.x)

## Required User Permissions

Modify Carts

## RETURN VALUE

On success, zero is returned.

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

## ERRORS

400 Missing Cart Number / Cut Number Error.

403 User Authentification Error.

404 No Such Cart/Code.

nnn Unknown Error Occurred.