# Remote Acess API Json Problem

**URL:** <https://community.jenkins.io/t/remote-acess-api-json-problem/17454>\
**Category:** Ask a question\
**Tags:** question\
**Created:** [July 24, 2024, 12:09pm UTC](https://community.jenkins.io/t/remote-acess-api-json-problem/17454 "2024-07-24T12:09:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ozanb](https://avatars.discourse-cdn.com/v4/letter/o/7feea3/32.png) [@Ozanb](https://community.jenkins.io/u/Ozanb)\
**Post date:** [July 24, 2024, 12:09pm UTC](https://community.jenkins.io/t/remote-acess-api-json-problem/17454/1 "2024-07-24T12:09:58Z")

</div>

Hi, I would like to start a jenkins job with json.  
I have successfully started a Jenkins job using URL-encoded parameters. Here’s how I did it:

```auto
  -H "$CRUMB" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "Component=$COMPONENT" \
  --data-urlencode "APPLICATION=$APPLICATION" \
  --data-urlencode "TARGET=$TARGET" \
  "$JENKINS_URL/job/$JOB_NAME/buildWithParameters")

```

This works well for me. I can also use Bash and Python to get the build number and other details.

However, I haven’t been able to post with JSON successfully. Every time I try, Jenkins uses the default parameters instead of the ones in my JSON file. Here’s one of my attempts:

```auto
  -H "$CRUMB_FIELD: $CRUMB" \
  -H "Content-Type: application/json" \
  --data @parameters.json \
  "$JENKINS_URL/job/$JOB_NAME/buildWithParameters"

```

```auto
{
  "parameter": [
    {
      "name": "value1",
      "value": "choice1"
    },
    {
      "name": "value2",
      "value": "choice2"
    },
    {
      "name": "TARGET",
      "value": "your_target_value"
    },
    {
      "name": "value4",
      "value": boolean
    }
  ]
}

```

And i also tried this.

```auto
  -H "$(curl -u "$USERNAME:$APITOKEN" -s "http://192.168.146.133:8080/crumbIssuer/api/json" | jq -r '.crumbRequestField + ": " + .crumb')" \
  -H "Content-Type: application/json" \
  -d '{
        "value1": "choice1",
        "value2": "choice2",
        "TARGET": "string",
        "value4": boolean
      }' \
  "http://192.168.146.133:8080/job/deneme/buildWithParameters"

```

Still can’t do any progress about this situation and there are my questions

- **How can I build with parameters using JSON?**
- **Do I need to use Bash or Python to get build information?**
- **Any suggestions or corrections?**

---

<div class="post-metadata">

**Author:** ![Ozanb](https://avatars.discourse-cdn.com/v4/letter/o/7feea3/32.png) [@Ozanb](https://community.jenkins.io/u/Ozanb)\
**Post date:** [August 8, 2024, 5:45pm UTC](https://community.jenkins.io/t/remote-acess-api-json-problem/17454/2 "2024-08-08T17:45:02Z")

</div>

Still cant figure it out any advice ?
