SharePoint - create folder if it doesn't already exist

@ManishMandot
Unfortunately, it appears trying to figure out exactly what I need to do in terms of the API call to list folders in a SharePoint document library is far enough outside of my skillset that I’m going to need more help.

I figure I need to get the SharePoint site details first, then I can pull that into the API call setup… but from there I’m lost.

I’m also not sure how to do the “if/then” scenario once I do get the folder list – i.e., if exists, then upload to the existing folder, if doesn’t exist, create new folder then upload to the new folder.



Am I at least on the right track?
Can you provide some additional guidance?

Thanks,
Scott