# Jenkins API in scripted Pipeline

**URL:** <https://community.jenkins.io/t/jenkins-api-in-scripted-pipeline/4019>\
**Category:** Using Jenkins\
**Created:** [September 29, 2022, 1:34pm UTC](https://community.jenkins.io/t/jenkins-api-in-scripted-pipeline/4019 "2022-09-29T13:34:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nuser](https://avatars.discourse-cdn.com/v4/letter/n/3bc359/32.png) [@nuser](https://community.jenkins.io/u/nuser)\
**Post date:** [September 29, 2022, 1:34pm UTC](https://community.jenkins.io/t/jenkins-api-in-scripted-pipeline/4019/1 "2022-09-29T13:34:25Z")

</div>

Hello,

While calling the Post API getting following error in scripted pipeline

hudson.AbortException: Fail: Status code 500 is not in the accepted range: 100:399

# pipeline code

stage(‘API’){  
steps{  
script{  
def response = httpRequest url: ‘[http://localhost:7055/APIIntegration/JenkinsAPI/](http://localhost:7055/APIIntegration/JenkinsAPI/)’ , httpMode: ‘POST’, requestBody: ‘{“value1”:“abc,abc@122”}’

```
        }
    }

```

}

Please look into this let me know where i am going wrong. I can able to get response from Postman.

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [September 29, 2022, 2:32pm UTC](https://community.jenkins.io/t/jenkins-api-in-scripted-pipeline/4019/2 "2022-09-29T14:32:57Z")

</div>

You are asking us why your application is returning a 500? It’s not really something we could know anything about. Hopefully the application you are running outputs lots so you can see errors.
