내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Listing Activities with REST

Avatar

Level 1

Hey there,
I'd like to build an website, which communicates through the target API in this manner: (https://mc.adobe.io/xxxxxxxxxxx/target/activities) and responds with a JSON I can then display in a table format on the frontend. However I'm blocked by CORS policy and I've read, that this is like this because of security reasons.

Is there any best-practice on how to achieve on what I want?

Kind regards and thanks a lot for your answers in advance,
Nikola

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 2

Hi Nikola,

You may have to call the admin APIs through your back-end server, considering CORS policy and the security risk of exposing "client secret" and your private key on the website.

 

I would implement it this way:

1. Your team sets up a custom endpoint (let us call it "/activities") in your backend server.

2.Page calls "/activities" endpoint in your back-end server.

3.Back-end takes care of jwt token authentication for accessing admin api, renews token if necessary.

3. Calls the adobe.io endpoint to retrieve activities list. 

4. Process the response on server itself if required.

5. Back-end server responds back to the page with the results.

 

Hope this helps.

원본 게시물의 솔루션 보기

1 답변 개

Avatar

정확한 답변 작성자:
Level 2

Hi Nikola,

You may have to call the admin APIs through your back-end server, considering CORS policy and the security risk of exposing "client secret" and your private key on the website.

 

I would implement it this way:

1. Your team sets up a custom endpoint (let us call it "/activities") in your backend server.

2.Page calls "/activities" endpoint in your back-end server.

3.Back-end takes care of jwt token authentication for accessing admin api, renews token if necessary.

3. Calls the adobe.io endpoint to retrieve activities list. 

4. Process the response on server itself if required.

5. Back-end server responds back to the page with the results.

 

Hope this helps.