def coord_to_string(coordinates):
    """Transform coordinates into a string for API"""
    if type(coordinates) == tuple:
        string = ','.join(list(map(str, coordinates)))

    elif type(coordinates) == dict:
        string = ','.join(list(map(str, coordinates.values())))

    elif (type(coordinates) == list) and (len(coordinates) == 2):
        string = ','.join(list(map(str, coordinates)))

    elif type(coordinates) == str:
        string = coordinates

    else:
        print('invalid coordinate type')
        string = None

    return string