Skip to main content
Question

Rest API change state


Forum|alt.badge.img+5
  • Do Gooder (Partner)
  • 18 replies

Hi, 

i am trying to release purchase order with a REST call,

i made an event action but i get the following message error : 

ExecutionException from Sender thread Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 11 

any one have an idea to fix this error ?

Regards.

11 replies

dsj
Superhero (Partner)
Forum|alt.badge.img+22
  • Superhero (Partner)
  • 824 replies
  • March 3, 2025

Hi ​@ZinT 

 

Maybe the empty payload body is the problem?

Can you add a valid json in the payload and see if it works?

 

Best regards,

Damith


Forum|alt.badge.img+5
  • Author
  • Do Gooder (Partner)
  • 18 replies
  • March 3, 2025

Hi 

Thank you for your quick response,

in postman it’s work fine with an empty body, in IFS i get the error message, 

i dont know what i have to put in the body because in the documentation of the API there is no body

Regards.


dsj
Superhero (Partner)
Forum|alt.badge.img+22
  • Superhero (Partner)
  • 824 replies
  • March 5, 2025

Hi ​@ZinT,

 

I have created a REST event action with an empty json and looks it’s sending without a problem.

It’s hard to guess what causes the OOB exception, but check if your client secret contains any special characters. 

I usually create a Postman  mock server and use that instead of the real token and rest urls to verify the outputs.

 

Hope it helps!

Damith


Forum|alt.badge.img+5
  • Author
  • Do Gooder (Partner)
  • 18 replies
  • March 5, 2025

Hello,

I checked the secret client but it only contains uppercase, lowercase and numbers.

i dont know why i get this error.

Thanks.


dsj
Superhero (Partner)
Forum|alt.badge.img+22
  • Superhero (Partner)
  • 824 replies
  • March 5, 2025

Hi ​@ZinT 

Not sure if the error was due to empty response (http 204) is received for this post call for state change. Try adding 204 as an accepted code for the rest sender.

Otherwise try the same with a workflow to see if it helps.

 


Forum|alt.badge.img+5
  • Author
  • Do Gooder (Partner)
  • 18 replies
  • March 6, 2025

Hi ​@dsj 

i add 204 to the accepted codes, but i get the same error.

with bpa i dont know how and wehre add connection information ( user, password….)

do you know how i can use client credentials in workflows ?

Thanks

dsj
Superhero (Partner)
Forum|alt.badge.img+22
  • Superhero (Partner)
  • 824 replies
  • March 6, 2025

Hi ​@ZinT 

 

Prior to 24R2, you need an additional step to fetch the auth token. With 24R2, Oauth2 protected endpoints can be invoked directly using the rest API task.

Check the blog post below (section  Bearer Token Authentication) for details on how to set it up

https://dsj23.me/2024/07/24/authenticating-rest-api-calls-in-ifs-workflows/

 

Hope it helps!

Damith


Forum|alt.badge.img+5
  • Author
  • Do Gooder (Partner)
  • 18 replies
  • March 6, 2025

Thank you ​@dsj 

i will try this and keep you informed.

Regards.


Forum|alt.badge.img+5
  • Author
  • Do Gooder (Partner)
  • 18 replies
  • March 7, 2025

Hi ​@dsj 

I tried to make a bpa, unfortunately I have an error 500, the error is already reported on community

 

Regards.


dsj
Superhero (Partner)
Forum|alt.badge.img+22
  • Superhero (Partner)
  • 824 replies
  • March 7, 2025

Hi ​@ZinT 

In which step you are hitting the 500 error?

can you share screenshot from the workflow troubleshoot details?

 

Regards,

Damith


Forum|alt.badge.img+5
  • Author
  • Do Gooder (Partner)
  • 18 replies
  • March 7, 2025

hi ​@dsj 

in calling my Api

Regards.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings