Multiple Import Sources

已查看 73 次
跳至第一个未读帖子

Katie Patterson

未读,
2021年6月24日 15:25:132021/6/24
收件人 apidev
Hi, I am wanting to find out how best to approach this problem.

My group's main adoptable animal data gets uploaded to Rescue Groups from ShetlerLuv automatically via FTP import tool, to then propagate all over the various export sites for adoptable animals.

We are starting another program for rehoming pets, and the pets in this program are not stored in ShelterLuv. These pets will be in AirTable which has an API. If I write a daily or hourly Python script to sync up the AirTable pets to our Rescue Groups account, will this mess up our automatic ShelterLuv imports?

Would it be best to do this via the JSON API on Rescue Groups, or would it be best to FTP a CSV file as a second import account? I would like the animals in ShelterLuv and the animals in AirTable to both show up in the various sites like Petfinder.

Related question, is there a list anywhere of accepted breeds for each species so I can do some verification of AirTable data before trying to export it?

Thanks
Katie

Susan Vertrees

未读,
2021年6月24日 17:11:122021/6/24
收件人 apidev、Katie Patterson
Hi @Katie - I'm a data architect in my day job, and dabble in Rescuegroups on the side. My first question to you would be why do you need both Shelterluv and Rescuegroups? Doesn't Shelterluv publish out to the export sites directly? If Rescuegroups does have to stay in play and I was running the world here, I would do a JSON API if possible. I can't imagine it would conflict with the FTP import.

The acceptable breeds can be grabbed by hitting the animalbreeds list action (in the v2 API). Example API call I did in Postman: 

{
"name": "Animals-List Breeds",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/x-www-form-urlencoded",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n\t\"token\":\"[token]\",\r\n    \"tokenHash\":\"[tokenhash]\",\r\n\t\"objectType\": \"animalBreeds\",\r\n\t\"objectAction\": \"list\"\r\n }"
},
"url": {
"protocol": "https",
"host": [
"api",
"rescuegroups",
"org"
],
"path": [
"http",
"v2.json"
]
}
},
"response": [
{
    "status": "ok",
    "messages": {
        "generalMessages": [],
        "recordMessages": []
    },
    "foundRows": 807,
    "data": {
        "622": {
            "name": "Huacaya",
            "species": "Alpaca"
        },
        "651": {
            "name": "Suri",
            "species": "Alpaca"
        },
        "530": {
            "name": "African Grey",
            "species": "Bird"
        },

// etc. 

]
}

Katie Patterson

未读,
2021年6月24日 18:18:292021/6/24
收件人 apidev、Katie Patterson
Hi Susan, thanks for the info about the animal breeds list, I will take a look at that. Shelterluv does not export to all the dozens of websites that Rescue Groups does. ShelterLuv only exports directly to Petfinder and Adoptapet. That is why we export ShelterLuv to Rescue Groups, and then let Rescue Groups do the export to all of those other sites. That part has been working fine for years so not worried about that.

I assume RG knows to delete animals if they disappear from the CSV upload. So my fear is that if I use the JSON API to add an animal not in Shelterluv, then when Shetlerluv uploads the new CSV file, RG will see that animal is not in the CSV file and will delete the animal from RG. Hoping someone has some clarification on how that would work.

Susan Vertrees

未读,
2021年6月24日 18:21:352021/6/24
收件人 apidev、Katie Patterson
No problem! The thing about having RG as an intermediary makes sense, but super annoying that Shelterluv doesn't syndicate out to all sites. If it helps any, our web data shows very few click throughs or adoption applications from the sites other than Petfinder or Adopt A Pet. 

I'm not totally sure how RG would handle a pet not being present in a CSV upload. I'm not sure if a CSV upload appends to the data in RG or completely overwrites it - maybe somebody else here can comment on that? 

If you hit the API for the animals object and call the add method, the animal will exist in RescueGroups until you change the status to deleted (which, fun fact, doesn't actually delete it from the system, only hides it but it is still in reporting). Unless the CSV thing does an animals object overwrite, which I think is the crux of your question. Can somebody else answer that question? 

Richard Saffell

未读,
2021年10月1日 19:21:392021/10/1
收件人 apidev、susan.v...@gmail.com、Katie Patterson
Hello Susan and Katie,

If an animal is imported via an Import Account, and then that animal (identified by External ID) is not in a processed file, it will be deleted.

If an animal is imported via an Import Account, edited manually or via API (or even Deleted I believe), when the animal is imported via the Import process again any changes will be overwritten.

Hope that helps,

Richard

回复全部
回复作者
转发
0 个新帖子