BigCommerce API - What is correct resource for updating an option value - api

I'm trying to update an option value using the BigCommerce api.
The documentation says PUT /options/values/id.json
The console says PUT options/id/values.json
I think it should be PUT options/id/values/id.json, which returns a 200 response code, but does not execute the update.
Any information on what the right endpoint is for this and if it works?

Basically, if you do a GET request on options
{
"id": 3,
"name": "Colors",
"display_name": "Color",
"type": "CS",
"values": {
"url": "https://store-xxx.mybigcommerce.com/api/v2/options/3/values.json",
"resource": "/options/3/values"
}
}
The resource endpoint shows that the URL is options/id/values.json. But, this gives you all the values associated with the option. If you want to retrieve a specific option the endpoint is something similar to /api/v2/options/3/values/7.json
{
"id": 7,
"option_id": 3,
"label": "Silver",
"sort_order": 1,
"value": "#cccccc"
}
Doing a PUT request on this - (On REST console, setting the header content-type to application/json and sending raw JSON data) updates the label - Changed Silver to silver)
{
"id": 7,
"option_id": 3,
"label": "silver",
"sort_order": 1,
"value": "#cccccc"
}

Related

The required field 'image_url' was not supplied

I am using big commerce API v3 https://api.bigcommerce.com/stores/xxxxxxxxxx/v3/ (catalog/products) to create a new product.
I want to pull this image from WEBDAV and I have uploaded this product as product_images/import/product-1.jpg in WEBDAV.
The input data is in POST like,
{
"categories": [
1,
2
],
"name": "My Product",
"sku": "MP1",
"type": "physical",
"depth": 0,
"price": 5,
"sale_price": 3,
"images": [
{
"image_file": "product-1.jpg"
}
],
"description": "My first product description"
},
but it is returned 400: The required field 'image_url' was not supplied.
It is working with full URL using image_url but not working with image_file.
Thank you for bringing this to our attention. The docs are going to be updated to clearly display the expected behavior and use of this endpoint.
The endpoint requires the "image_url" path, which you do not have by only uploading the file with webdav. So, after you upload the image to webdav, you will have to add the store url prior to the image path. Like "image_url": "https://store-domain.com/product-1.jpg"

How to get a VM Flavours in IBM cloud through Softlayer Rest API

I want to get a VM Flavours(Compute C1.2x2, Balanced B1.2x8) using Softlayer Rest API. I didn't find any API references related to get Flavours.
To retrieve the active VM flavors use the following rest api call:
Method: GET
https://[username]:[apiKey]#api.softlayer.com/rest/v3/SoftLayer_Product_Package/835/getActivePresets
You will get a response like the below example:
[
{
"description": "B1.16x64x100",
"id": 351,
"isActive": "1",
"keyName": "B1_16X64X100",
"name": "B1.16x64x100",
"packageId": 835
},
{
"description": "C1.1x1x100",
"id": 359,
"isActive": "1",
"keyName": "C1_1X1X100",
"name": "C1.1x1x100",
"packageId": 835
},
]

Creating an event through the ST Developer Portal's API Console

I'm trying to create an event using the API console and keep getting errors. Any ideas why?
I've been using different versions of the example value:
{
"name": "string",
"description": "string",
"status": "string",
"event_id": "string",
"start_epoch": 0,
"end_epoch": 0,
"industry": "string",
"archived": true,
"deleted": true,
"legacy_id": 0,
"is_public": true
}
I get the following back. Any thoughts?
{
"code": "BadRequestError",
"message": "[\"Has time can't be blank\",\"true is not included in the list\"]"
}
You will need to fetch the user/team information first
Once you have your oauth token from above and set to the Authorization header, make a call to https://developer-portal.socialtables.com/api-console#!/Authentication/get_4_0_oauth_token
This will give you the user and team object back to make subsequent calls to make events
Once you have the team_id you can now make events
You can POST to /4.0/events
Swagger doc: https://developer-portal.socialtables.com/api-console#!/Events/post_4_0_events
Example POST payload:
{
"name": "NAME",
"description": "DESCRIPTION",
"status": "new",
"start_epoch": TIME_IN_MS,
"end_epoch": TIME_IN_MS,
"industry": "INDUSTRY_TYPE",
“has_time”: 1 // 0 = all day event, 1 = from/to a specific time in day
}
- This will return the event ID under data.event.id in the response from the above POST
- You can then link the user to:
https://home.socialtables.com/events/EVENT_ID

HERE Places API: not all items have PVID

I'm using HERE Places API.
Firstly I'm doing a search.
For Example this query :
https://places.cit.api.here.com/places/v1/discover/search?q=Test&at=35.6111,-97.5467&r=500&size=1&app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&show_refs=pvid&pretty
According to this documentation (Link) If I add show_refs=pvid to query string, in result I will get external id which I can use to query lookup endpoint.
But in result I get next response :
{
"results": {
"next": "https://places.cit.api.here.com/places/v1/discover/search;context=Zmxvdy1pZD1hY2ExNzk3NC0zYzg3LTU5NzQtYmZkMC04YjAzMDZlYWIzMWJfMTUwNjA3NjMzMTYyMl83NDY3XzM4NTAmb2Zmc2V0PTEmc2l6ZT0x?at=35.6111%2C-97.5467&q=Test&app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg",
"items": [
{
"position": [
35.60369,
-97.51761
],
"distance": 2756,
"title": "Southwest Test & Balance",
"averageRating": 0,
"category": {
"id": "business-services",
"title": "Business & Services",
"href": "https://places.cit.api.here.com/places/v1/categories/places/business-services?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg",
"type": "urn:nlp-types:category",
"system": "places"
},
"icon": "https://download.vcdn.cit.data.here.com/p/d/places2_stg/icons/categories/02.icon",
"vicinity": "200 NW 132nd St<br/>Oklahoma City, OK 73114",
"having": [],
"type": "urn:nlp-types:place",
"href": "https://places.cit.api.here.com/places/v1/places/8403fv6k-d1b2fde0616e0326e321a54b88cd9f53;context=Zmxvdy1pZD1hY2ExNzk3NC0zYzg3LTU5NzQtYmZkMC04YjAzMDZlYWIzMWJfMTUwNjA3NjMzMTYyMl83NDY3XzM4NTAmcmFuaz0w?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg",
"id": "8403fv6k-d1b2fde0616e0326e321a54b88cd9f53",
"authoritative": true
}
]
},
"search": {
"context": {
"location": {
"position": [
35.6111,
-97.5467
],
"address": {
"text": "Oklahoma City, OK 73134<br/>USA",
"postalCode": "73134",
"city": "Oklahoma City",
"county": "Oklahoma",
"stateCode": "OK",
"country": "United States",
"countryCode": "USA"
}
},
"type": "urn:nlp-types:place",
"href": "https://places.cit.api.here.com/places/v1/places/loc-dmVyc2lvbj0xO3RpdGxlPU9rbGFob21hK0NpdHk7bGF0PTM1LjYxMTE7bG9uPS05Ny41NDY3O2NpdHk9T2tsYWhvbWErQ2l0eTtwb3N0YWxDb2RlPTczMTM0O2NvdW50cnk9VVNBO3N0YXRlQ29kZT1PSztjb3VudHk9T2tsYWhvbWE7Y2F0ZWdvcnlJZD1jaXR5LXRvd24tdmlsbGFnZTtzb3VyY2VTeXN0ZW09aW50ZXJuYWw;context=c2VhcmNoQ29udGV4dD0x?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg"
}
}
}
In response no object references
Is it a bug or not every place has this external id?
I am responding as member of the team around HERE Places API.
Yes, not every place has a pvid. That is why I would suggest using the Sharing Id instead. I realize that the documentation should be improved to clarify that.
The Sharing Ids can be obtained by adding show_refs=sharing to either your search query or a place details request. It can be found in the field references. Once you have the sharing id you can you the lookup endpoint as you intended.
Take a look at:
https://places.cit.api.here.com/places/v1/places/8403fv6k-d1b2fde0616e0326e321a54b88cd9f53;context=Zmxvdy1pZD00YWU2ZWZjNi01ZjgzLTUwYTQtOTI4OS0xZjliMGMwNWY3NjBfMTUwNzA0NDE0OTc3NV84MTI5XzU1NDcmcmFuaz0w?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&show_refs=pvid
and
https://places.cit.api.here.com/places/v1/places/8409q8yy-6af3c3e50bcb4f859686797b2be5773d;context=Zmxvdy1pZD00YWU2ZWZjNi01ZjgzLTUwYTQtOTI4OS0xZjliMGMwNWY3NjBfMTUwNzA0NDE0OTc3NV84MTI5XzU1NDcmcmFuaz0w?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&show_refs=pvid
On those two examples, the only difference is the placeId.
In the docs, there's not a single reference saying that the external identifier is required or existant for every place.
Since it represents an external identifier, I believe we could assume that it's not required.
And it's what we just saw with your place (8403fv6k-d1b2fde0616e0326e321a54b88cd9f53): this one don't have any external identifier.
Based on your comments, what you need is the information about a place.
So, after you run your first query, you should get something like:
{
title: "Southwest Test & Balance",
position: [],
id: "8403fv6k-d1b2fde0616e0326e321a54b88cd9f53",
href: "https://[...]"
}
With this ID, you could access it:
places.cit.api.here.com/places/v1/places/8403fv6k-d1b2fde0616e0326e321a54b88cd9f53;context=Zmxvdy1pZD0zYTFlZjg5ZS02ZTY5LTUxYmEtYWFkYS1kY2UwZWMyNDdkMDBfMTUwNzEzNjUxNjI5N182NjExXzc2OTgmcmFuaz0w?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg
Or directly using the href information.
This response already is giving you the ID and URL to access all the info of a single place.
You don't need any other external ID or reference.

JIRA Rest API select minimal resource

I am using JIRA REST API for querying issues with below jql
jql=project =SLUB and "Agile Team" in ("Iris (B2C)")&fieldsByKeys=true&fields=status&maxResults=1
I am getting api response as
{
"expand": "names,schema",
"startAt": 0,
"maxResults": 1,
"total": 1172,
"issues": [
{
"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
"id": "35988",
"self": "https://xyz.atlassian.net/rest/api/2/issue/35988",
"key": "SLUB-7071",
"fields": {
"status": {
"self": "https://xyz.atlassian.net/rest/api/2/status/10200",
"description": "",
"iconUrl": "https://xyz.atlassian.net/",
"name": "To Do",
"id": "10200",
"statusCategory": {
"self": "https://xyz.atlassian.net/rest/api/2/statuscategory/2",
"id": 2,
"key": "new",
"colorName": "blue-gray",
"name": "To Do"
}
}
}
}
]
}
How can I only fetch status name instead of complete status resource. Please suggest.
https://docs.atlassian.com/jira/REST/latest/#d2e3181
Check This .
The fields param (which can be specified multiple times) gives a comma-separated list of fields to include in the response. This can be used to retrieve a subset of fields. A particular field can be excluded by prefixing it with a minus.
By default, only navigable (*navigable) fields are returned in this search resource. Note: the default is different in the get-issue resource -- the default there all fields (*all).
*all - include all fields
*navigable - include just navigable fields summary,comment - include just the summary and comments
-description - include navigable fields except the description (the default is *navigable for search)
*all,-comment - include everything except comments
Copied From Here.