skip to content

IT Help and Support

University Information Services
 

How to set forwarding addresses for your institutions’ members

Insitution Lookup editors and managers can set the forwarding address of @cam.ac.uk email accounts for their institution's members. This is particularly useful for institutions that want to set the forwarding address to their own institutional email system.

Anyone within an institution’s editors group can also view and edit the @cam delivery address of any person who is a member of their institution.  

The @cam delivery address can be edited within Lookup’s user interface by visiting the profile of the person you want to edit,  by clicking the ‘edit’ button at the bottom of the page, setting the @cam delivery address attribute within the list of attributes for this person, and clicking ‘save’.

Alternatively, the @cam delivery address can be set or updated through Lookup’s API. To access the @cam delivery address through the API, you must authenticate as a Lookup group, and that Lookup group must be added to your institution’s editors Lookup group.

To do this you must first create a group and assign it a password. Then, within your institution’s editors group, add your newly created group to the list of “Included groups”. This gives you the ability to use Lookup’s API using the group name and password you generated with the same level of permissions as a person who is a member of your institution editor’s group.

Using your group credentials, you should now be able to see the forwarding email address of any member of your institution at: https://www.lookup.cam.ac.uk/api/v1/person/crsid/{CRSID}?fetch=forwardingEmail.

The following python3 text shows how you can use Lookup’s API to update the @cam delivery address.

```

from ibisclient import createConnection, PersonMethods

def main():

    target_crsid = '<crsid of the person whose @cam delivery address you want to change>'

    connection = createConnection()

    connection.set_username('<group name here>')

    connection.set_password('<group password here>')

    person_methods = PersonMethods(connection)

    # fetch the person whose delivery address we want to update

    person = person_methods.getPerson('crsid', target_crsid, 'forwardingEmail')

    # find the forwarding email attribute

    forwardingEmail = next((attr for attr in person.attributes if attr.scheme == 'forwardingEmail'))

    # update it in place and use updateAttribute to set the new value in Lookup

    forwardingEmail.value = 'updated@test.cam.ac.uk'

    person_methods.updateAttribute('crsid', target_crsid, forwardingEmail.attrid, forwardingEmail)

    print(f'Updated forwarding email to {forwardingEmail.value}')

 

if __name__ == '__main__':

    main()

```

More information about Lookup’s API is available at: https://www.lookup.cam.ac.uk/doc/ws-doc/.