I am trying to get gene name from the SNP ID, I came across some posts and came up with this, but I am getting an error 

Here is my code

    library(biomaRt)
    ensembl = useMart("ensembl",dataset="hsapiens_gene_ensembl")
    getBM(attributes = c("external_gene_name"),
      filters    = "snp_filter", values = "rs3043732", mart = ensembl)

This is the error

    Error in getBM(attributes = c("external_gene_name"), filters = "snp_filter",  : 
     Invalid filters(s): snp_filter 
    Please use the function 'listFilters' to get valid filter names

I am thinking that the "snp_filter" must have changed in the new version, but I am not able to find the new filter that serves the same purpose. Also is the "external_gene_name" is what the gene name that corresponds to the SNP ID ?
rs3043732 is no longer in dbSNP. Take a look <a href="https://www.ncbi.nlm.nih.gov/projects/SNP/snp_ref.cgi?searchType=adhoc_search&type=rs&rs=rs3043732">HERE</a>.

To look up rs IDs in biomaRt, you need to do this:

    require(biomaRt)

    ensembl <- useMart("ENSEMBL_MART_SNP", dataset = "hsapiens_snp")

    getBM(attributes=c(
        "refsnp_id", "chr_name", "chrom_start", "chrom_end",
        "allele", "mapweight", "validated", "allele_1", "minor_allele",
        "minor_allele_freq", "minor_allele_count", "clinical_significance",
        "synonym_name", "ensembl_gene_stable_id"),
        filters="snp_filter", values="rs6025",
        mart=ensembl, uniqueRows=TRUE)

      refsnp_id chr_name chrom_start chrom_end allele mapweight
    1    rs6025        1   169549811 169549811    C/T         1
                                                                           validated
    1 1000Genomes,Cited,ESP,ExAC,Frequency,gnomAD,HapMap,Phenotype_or_Disease,TOPMed
      allele_1 minor_allele minor_allele_freq minor_allele_count
    1        C         TRUE        0.00599042                 30
                            clinical_significance synonym_name
    1 benign,pathogenic,drug response,risk factor        17284
      ensembl_gene_stable_id
    1        ENSG00000198734


Look up all available attributes with `listAttributes(ensembl)`

Kevin