Airtable<>AEM Programmatic calls through API | Community
Skip to main content
January 20, 2023
Solved

Airtable<>AEM Programmatic calls through API

  • January 20, 2023
  • 4 replies
  • 1540 views

Hello,

 

I'm trying to call the AEM HTTP API from Airtable's scripting block through a simple Javascript runtime environment. All my calls work fine on Postman, but not from Airtable. The GET calls go through fine, but the POST get a 403.

 

Any help much appreciated 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jagadeesh_Prakash

@mmaattee below is the sample code to allow post calls in dispatcher filter

 

/0211 { /type "allow" /method "POST" /path "/content/<path>/*" }

 

4 replies

Aditya_Chabuku
Community Advisor
Community Advisor
January 20, 2023

Hi @mmaattee ,

 

Are you trying to Create an asset in AEM or retrieve it..?

In HTTP API use these methods as per requirements.

  • GET - to retrieve a JSON representation of an asset or a folder
  • POST - to create new assets or folders
  • PUT - to update the properties of an asset or folder
  • DELETE - to delete an asset or folder

In Your case, If you want to retrieve assets use GET, for example: /api/assets/myFolder.json

if you want to Create an Asset then use POST, like

POST /api/assets/myFolder -H"Content-Type: application/json" -d '{"class":"assetFolder","properties":{"jcr:title":"My Folder"}}' POST /api/assets/* -F"name=myfolder" -F"jcr:title=My Folder"

 

I give a link for API Documentation here for your reference https://experienceleague.adobe.com/docs/experience-manager-65/assets/extending/mac-api-assets.html?lang=en#create-a-folder  

Thanks,Aditya Chabuku
Jagadeesh_Prakash
Community Advisor
Community Advisor
January 20, 2023

@mmaattee can you give the environment details, AEM onprem or AEMaaCS ?

 

is the post call allowed in dispatcher?

Jagadeesh_Prakash
Community Advisor
Jagadeesh_PrakashCommunity AdvisorAccepted solution
Community Advisor
January 20, 2023

@mmaattee below is the sample code to allow post calls in dispatcher filter

 

/0211 { /type "allow" /method "POST" /path "/content/<path>/*" }

 

B_Sravan
Community Advisor
Community Advisor
January 20, 2023

seems like the POST calls are filtered, please update your dispatcher configurations to allow the request and for your local environment you can disable the filter.

Ritesh_Mittal
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
January 20, 2023

Hi @mmaattee ,

 

I have few queries-

 

1. When you have mentioned it is working using postman, is it same AEM endpoint which is not working Airtable's scripting block?

2. Have you checked Adobe Granite CSRF Filter, for example the user agents?

3. Have you validated if the request is allowed from dispatcher?

4. Have you checked 'Apache Sling Referrer Filter', the Allow Hosts one?

 

https://www.youtube.com/watch?v=Yn7ybOwfIYY&t=535s 

 

Thanks,

Ritesh