You have to build the array as the json array needs to be
$args = array(
'headers' => array(
'Content-Type' => 'application/json',
'Authorization' => 'Basic '.$apiKey
)
);
$bdy = array(
'fields'=> array(
'project' => array(
'key' =>'LD'
),
'summary'=> 'CODING WORKS',
'description' => 'Creating of an issue using project keys and issue type names using the REST API',
'issuetype' => array(
'name'=> 'Candidate'
)
)
);
$pload = array(
'method' => 'POST',
'timeout' => 30,
'redirection' => 5,
'httpversion' => '1.0',
'blocking' => true,
'headers' => $args,
'body' => json_encode($bdy)
);
$response = wp_remote_post ('https://mysite.atlassian.net/rest/api/2/issue',$pload);
Related Posts:
- Woocommerce api: create product with images – bad request
- Adding Microsoft Teams Incoming Webhook to WordPress, Problem with Rest Route?
- WP-API v2 Custom Endpoint Response Formatting
- How to loop through JSON data in wordpress WP REST API
- Creating a post with the REST API, curl and oauth returning 401 error
- Does the REST API (official) support custom post types?
- wordpress custom endpoint multiple params
- Create a range slider to change font-size with different screens sizes in wordpress customizer api
- Building a REST API for your web app exposes primary keys of DB records?
- How to set a template with wp_insert_post
- How can I spin up a new website for a registered user automatically?
- Is it possible to create new user from external form using REST API?
- How to clone all WordPress Rest API end points
- Flatten Responses returned via WP REST API via WP_Error for obfuscation
- REST API Plugin Update call back not updating the plugin
- Can external API content be added to Rest API in WordPress
- WordPress Custom API GET request from External App with XML Parameter
- Query WP REST API v2 by multiple meta keys
- Uploading media with the REST API
- How do I cache (core) API requests?
- WP REST API only returning partial list of users
- Is there a way to get protected meta fields through any of the available built-in WordPress APIs? (xmlrpc, wp-json)
- cURL 28 error after switch from to brew php 7.2 on localhost
- Retrieving pages with multiple tags using REST API
- How do I use the WP REST API plugin and the OAuth Server plugin to allow for registration and login?
- WP API V2 returning Invalid User ID
- WP API : date_query parameter
- How to make an meta_query optional?
- Unrendered content Cornerstone through REST API
- Get more than 10 posts in a specific category with the wordpress api
- Create a new user using WP REST API and declare meta object
- Ajax call to my WordPress website from an external application [duplicate]
- Problem with Woocommerce REST API Authentication
- How Do I Add User Custom Field to REST API Response?
- register_rest_route regex option for base64 or alternate
- Show different Customizer Settings on Page-Tamplates
- Create post with REST API in php with file_get_contents
- WordPress REST API “rest_authentication_errors” doesn’t work external queries?
- Continue execution after WP REST API response
- using woocommerce_template_single_add_to_cart in shop-loop – javascript issues [closed]
- how to decode % in app [closed]
- How to generate HMAC-SHA1 signature to use with WP REST API and OAuth1
- node-wpapi: how to handle authentication?
- Get all tags not just first 10 with wp api 2.0
- How do I fetch all comments per post via WP REST API?
- How to add WP API and JS featured image attachment
- Difference between ‘type’ => ‘text’ and WP_Customize_Control
- Shortcode API: How to get name that matched shortcode RegEx?
- How to filter posts by post format “standard” from wp-json api?
- woocommerce registration form with klaviyo(don’t work with current user)
- WP_REMOTE_POST Requests are being blocked by API provider [closed]
- Why is the post meta[] empty when I make a call to the wordpress rest api?
- WordPress 5 WP REST routes – No errors
- Is there an equivalent to WP_Error object I can return in the case of a successful REST request?
- Change the CSS of the Customizer API
- Woocommerce hook run after an Order been created through REST API
- what is the best practice to add new field to an api route
- Fetch post block/field data as JSON with WordPress API
- How to show single category archive
- Adding custom end points, No error line
- Using WP-API and SSE not authenticating user ID
- Woocommerce: hook action/filter I could use to add variation id and price with each attribute opt on WooCommerce Rest api
- AdWords API with WP
- Run A Pre-Built Core PHP Application Under A WordPress Page or Post Route
- base64_encode conflict with convert_smilies in wordpress
- get_body_params() is always empty in POST request
- Headers already sent error with get_template_part in REST API call
- Properly process a custom WP REST API request (Authenticate, Authorize + Validate)?
- How to update WordPress Plugins in your own maintance application?
- How to pass and validate nonce in custom REST routes
- rest_cannot_create_user – Sorry, you are not allowed to create new users. CURL WORDPRESS REST API
- Query posts by custom taxonomy slug in WP REST API?
- oneOf JSON Schema validation not properly working for custom post meta value?
- Create custom API endpoint to change custom header image
- Why is this specific API request failing when sending via wp_remote_post?
- How to cut a section of a URL from a string with a regular expression?
- REST API custom endpoints for metaboxes
- Authenticate + Authorize WP REST API request before built-in WP JSON Schema Payload Validation?
- External api call using wordpress
- Woocommerce API for calling products by Category ID
- WordPress REST API – Custom field not added to pages
- How to submit a button automatically after every scheduled hours?
- What is different about using admin-ajax.php in an endpoint and just submitting a form from the front end?
- i need to resive data external api and show user
- wordpress-plugin (widget) that performs a Neaby-search on the openstreetmap-endpoint: around x find y
- regsiter a new user through WordPress API with Google SSO doesn’t work properly
- Display endpoint’s return into a file (file_put_contents())
- Read data from external source. XML vs REST API
- Encountering 400 Bad Request Error When Sending Form Information to API through Elementor
- Transmit headers and footers via API from one site to another
- Application password header not checked in REST API
- register_rest_route, Compare purchase codes and send a response
- Authorization and execution of the link
- Registered a REST Route but I’m Getting a 400 Bad Request
- How to pass a file to an API call through WordPress
- Can’t make an external api call in php side of wordpress child theme
- WP_Error Object in wp_remote_post & wp_remote_get
- WP rest api and litespeed incompatibility
- Custom rest fields not loaded in rest api cpt response
- REST API request between domain and subdomain