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
- Query WP REST API v2 by multiple meta keys
- Uploading media with the REST API
- WP REST API only returning partial list of users
- 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
- 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?
- Show different Customizer Settings on Page-Tamplates
- 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]
- node-wpapi: how to handle authentication?
- 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
- 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?
- Is there an equivalent to WP_Error object I can return in the case of a successful REST request?
- 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
- How do I start using an external API and PHP for a WordPress.org page?
- Store a default value for a transient on plugin activation
- Are nonces in WP REST API optional by default?
- PHP > Scheduled Tasks > Sending daily email with dynamic API variables
- How can I call specific function if requested URL is not found?
- JSON REST API WordPress only showing first 10 categories
- Get a remote post ID via API given URL
- Buddypress update user avatar image via REST
- Delete taxonomy and delete all post related it
- Multiple requests external data api dynamic block gutenberg
- Creating a WordPress Post via REST API – HTML or Markdown?
- Cant register rest routs from class instance
- Custom REST endpoint not working to retrieve single posts (“rest_no_route”)
- WordPress REST API register_rest_route give a 500 error
- Filter by field with array value in ACF on WP REST API
- WP REST API and Access-Control-Allow-Origin
- no_rest_route error on custom routes
- WordPress REST API – get custom taxonomy category posts
- How to display relations via wordpress Rest API
- Creating a brand attribute as a variable
- REST api returns 404 on some WordPress sites
- Integrate admin plugin into template. Very interesant (live search + autocomplete with wp rest api, in vanilla js)
- Require()/Include() post template adding extra content
- Create a WordPress Contact Form to call a POST AWS API Gateway and send user data
- Escape commas in REST API
- WordPress 5.6 Application Passwords
- Force REST API Authentication for each request method
- WordPress REST API in Integromat: How to overcome “Sorry, you are not allowed to list users / edit this…”
- Help to create the best plugin settings!
- REST API custom endpoint to fetch pages and posts not working
- Adding Amchart Interface to WordPress API
- get Woocommerce product format json for WP_Query
- Deleting media using the WordPress Rest API
- $_GET[‘title’] in WordPress
- How do I create a WP endpoint that retrieves all custom post types that have a tag?
- Pulling Products from an API
- How can i get the same ajax result using WP REST API instead of admin-ajax?
- Extending the API I created to return category names
- 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
- 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
- External api call using wordpress
- Woocommerce API for calling products by Category ID
- WordPress REST API – Custom field not added to pages