Expand my Community achievements bar.

Unable to make call to Campaign API

Avatar

Employee

I have setup a firefly app and build a project using the out of box template. However whenever I make a call to the Campaign's getProfiles api call (out of box ) it shows a server error. There is no other error to debug why this could be happening.

I have also used the project from here https://github.com/AdobeDocs/adobeio-samples-customers-dashboard However the same error when making a call to either getprofiles or send-promo.

Below is the debug stmts when debugging thru VS code

 

GET-PROFILES

 

020-07-01T17:43:01.358544100Z 2020-07-01T17:43:01.355Z [main /260965-campaigndashboard-stage/customers-dashboard-0.0.2/__secured_get-profiles] info: Calling the main action
2020-07-01T17:43:01.361061600Z 2020-07-01T17:43:01.360Z [main /260965-campaigndashboard-stage/customers-dashboard-0.0.2/__secured_get-profiles] debug: {"LOG_LEVEL":"debug","__ow_headers":{"accept":"*/*","accept-encoding":"gzip, deflate, br","accept-language":"en-US, en;q=0.9","authorization":"<hidden>","connection":"close","content-type":"application/json","host":"controller-a","origin":"https://localhost:9080","perf-br-req-in":"1593625379.689","referer":"https://localhost:9080/?_mr=https%3A%2F%2Fexperience.adobe.com%2Fassets%2Fruntime.0c1c1f0b.js&shell_...","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36","x-forwarded-for":"67.188.179.10, 10.250.204.31","x-forwarded-host":"260965-campaigndashboard-stage.adobeioruntime.net","x-forwarded-port":"443","x-forwarded-proto":"https","x-gw-ims-org-id":"xxxxxxx@AdobeOrg","x-request-id":"UJY4lMkbcNVHPBc3dgXsC0SfE79kSn8L"},"__ow_method":"post","__ow_path":"","apiKey":"c54465b21e7042a1b43ad4f","body":{"message":"validation success"},"statusCode":200,"tenant":"acs1008.msavlab"}
2020-07-01T17:44:05.970552500Z 2020-07-01T17:44:05.969Z [main /260965-campaigndashboard-stage/customers-dashboard-0.0.2/__secured_get-profiles] error: [CampaignStandardSDK:ERROR_GET_ALL_PROFILES] Error: Bad Request
2020-07-01T17:44:05.971044700Z 2020-07-01T17:44:05.970Z [main /260965-campaigndashboard-stage/customers-dashboard-0.0.2/__secured_get-profiles] info: 500: server error
2020-07-01T17:44:05.975235300Z XXX_THE_END_OF_A_WHISK_ACTIVATION_XXX
2020-07-01T17:44:05.977268700Z XXX_THE_END_OF_A_WHISK_ACTIVATION_XXX
Completed activation c43e0523f1b44d34be0523f1b4bd349b in 64.661 sec
{ error: { statusCode: 500, body: { error: 'server error' } } }

 

GET-PROMO

2020-07-01T17:47:58.371923000Z 2020-07-01T17:47:58.371Z [main /260965-campaigndashboard-stage/customers-dashboard-0.0.2/__secured_send-promo] debug: {"LOG_LEVEL":"debug","__ow_headers":{"accept":"*/*","accept-encoding":"gzip, deflate, br","accept-language":"en-US, en;q=0.9","authorization":"<hidden>","connection":"close","content-type":"application/json","host":"controller-a","origin":"https://localhost:9080","perf-br-req-in":"1593625678.149","referer":"https://localhost:9080/?_mr=https%3A%2F%2Fexperience.adobe.com%2Fassets%2Fruntime.0c1c1f0b.js&shell_...","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36","x-forwarded-for":"67.188.179.10, 10.250.204.31","x-forwarded-host":"260965-campaigndashboard-stage.adobeioruntime.net","x-forwarded-port":"443","x-forwarded-proto":"https","x-gw-ims-org-id":"XXXXXXX@AdobeOrg","x-request-id":"Ot8eYCa0okYQqidX7jbtTsI7ew3I9gvk"},"__ow_method":"post","__ow_path":"","apiKey":"c54465b21e7042a1b43ad4f","body":{"message":"validation success"},"email":"test@gmail.com","statusCode":200,"tenant":"acs1008.msavlab","workflowId":"wkf1"}
2020-07-01T17:48:44.347600000Z 2020-07-01T17:48:44.346Z [main /260965-campaigndashboard-stage/customers-dashboard-0.0.2/__secured_send-promo] error: [CampaignStandardSDK:ERROR_GET_WORKFLOW] Error: Bad Request
2020-07-01T17:48:44.349630200Z 2020-07-01T17:48:44.346Z [main /260965-campaigndashboard-stage/customers-dashboard-0.0.2/__secured_send-promo] info: 500: server error
2020-07-01T17:48:44.349699200Z XXX_THE_END_OF_A_WHISK_ACTIVATION_XXX
2020-07-01T17:48:44.350816300Z XXX_THE_END_OF_A_WHISK_ACTIVATION_XXX
Completed activation 5fe9be62f3a34beea9be62f3a3fbeef4 in 45.995 sec
{ error: { statusCode: 500, body: { error: 'server error' } } }

 

The tenant of my Campaign instance is acs1008.msavlab, could that be reason for the issue ?

Any help would be appreciated.

Thank you.

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

12 Replies

Avatar

Employee
Hi - does it work when you make a request directly to ACS API? Are you able to get profiles using the API?

Avatar

Employee
Thanks duypnguyen, it was user error had the incorrect Campaign_tenant Id in the configuration. However the process to debug is not straight forward as we get a very generic server error message.

Avatar

Employee
Ok - great to hear that it's working for you now. The SDK relies heavily on the errors returned from the ACS API. While we try to provide as much useful info as possible in the error messages, some are hard to capture without a detailed message from the API. What you got looks like an instance of that.

Avatar

Employee

@harpreet_ahluwa , according to the comment, the error was due to an incorrect tenant ID. You should be able to run the code with a correct tenant.

Please let me know if you have other questions.

Avatar

Employee Advisor
@duypnguyen I'm facing the same issue and I have validated the tenant id and it is correct. If I try the same endpoint (https://55762-acscustomers-dev.adobeioruntime.net/api/v1/web/acscustomers-0.0.1/get-profiles) with all the required headers in postman I get the same "server error" but if I try the ACS API endpoint to get all the profiles, it works fine ({{acs_url}}/campaign/profileAndServices/profile). Please suggest what could be missing.

Avatar

Employee
@shelly-goel - do you see some logs from the activation? or any code to share?

Avatar

Employee Advisor

I get the same error in logs for getProfiles() as mentioned in this post. I created a new project with template and ACS runtime action and added the tenant in .env.

shelly-goel_1-1607961796478.png

I have tried to debug as well though exception is thrown in the campaignClient and error does not clearly state what exactly is incorrect (if it is in the header)

shelly-goel_2-1607961886266.png

 

 

 

Avatar

Employee
Can you run the same calls in postman against the same campaign instance using the same auth token?

Avatar

Employee

would be useful to console.log the value of "params.apiKey", "params.tenant" and "token" before the "CampaignStandard.init" line, and verify that they are valid using the postman call as dr_venture recommended. The error "400 Bad Request" suggests that some of these values might be null of wrong.

Avatar

Employee Advisor
Yes I've tried with postman and I get same error like I mentioned before. I think it's mostly related to tenant as token or org gives relevant error. This is the ACS instance URL: "<some alphanumeric characters>.campaign-sandbox.adobe.com", please suggest the correct tenant id in this case though I have tried several permutations..

Avatar

Employee
Could you try putting the whole "<some alphanumeric characters>.campaign-sandbox.adobe.com" as tenant ID? I could recall that I used this "campaign-sandbox" pattern once and needed to give the full URL. Ideally you should contact your ACS techops who can share with you the exact tenant ID.

Avatar

Employee Advisor
@duypnguyen Thanks the complete url worked fine as the tenant. I did try it earlier as well, may be the setting might not have got deployed. Thanks again.