Formulating REST API call - api

Here is my query string
https://api.meetup.com/2/open_events?country=us&state=ca&city=sanfrancisco&category=34&page=10&group_photo&sign=true&&sign=true
I'm having no success reaching the group_photo resource.
In the docs they say:
group_photo
Returned when fields request parameter contains "group_photo".
Represents photo for the group hosting the event
I tried changing group_photo to group_photo=true but that didn't help.
Here's the console if you wanna test it

From the Meetup API documentation:
fields: Request that additional fields (separated by commas) be
included in the output
and
group_photo: Returned when fields request parameter contains
"group_photo". Represents photo for the group hosting the event
so you must add fields=group_photo and the call you gave above would be be something like:
https://api.meetup.com/2/open_events?country=us&state=ca&city=sanfrancisco&category=34&page=10&fields=group_photo&sign=true&sign=true

Related

Access existing Correlation ID

When returning Problem result ASP.NET generates standartized responce model that includes "traceId": "00-d98512464f3f5a4b9ac3b8e02a03ecd0-8720663d0b55c94a-00". That traceId is actually Correlation id since it includes Span Id and other stuff.
That's great for error responses, but I also want to get that value for valid ones. Possible solution for this is to add it to response headers.
Issue is I have no idea, how to get it (except calling Problem().Value and getting it from there).
Look at System.Diagnostics.Activity.Current (docs)
It has the properties SpanId, TraceId and Id. Id returns the same value as Problem result (00-d98512464f3f5a4b9ac3b8e02a03ecd0-8720663d0b55c94a-00 in your case).

Why I only getting id's back in response? IGDB api

I already read the documentation and I think I am making the simplest request in the correct way, but it always returns only the IDs, instead of all the fields of the games
Documentation example: Documentation Example
The request header is fine. I know this because I can get the expected request if fields = * as querystring
this is my request:
You have to provide the fields you want inside the body.
Like this:
fields age_ratings,aggregated_rating,aggregated_rating_count,alternative_names,artworks,bundles,category,checksum,collection,cover,created_at,dlcs,expansions,external_games,first_release_date,follows,franchise,franchises,game_engines,game_modes,genres,hypes,involved_companies,keywords,multiplayer_modes,name,parent_game,platforms,player_perspectives,rating,rating_count,release_dates,screenshots,similar_games,slug,standalone_expansions,status,storyline,summary,tags,themes,total_rating,total_rating_count,updated_at,url,version_parent,version_title,videos,websites;"

Vimeo API get multiple videos in one GET request

I'm in a situation where I need to make one GET request to Vimeo and get back info for multiple specific videos. Here is what I have for the query string currently:
https://api.vimeo.com/users/XXXXXXXX/videos?fields=uri,duration,pictures.sizes.link,download&containing_uri=/videos/ID1,/videos/ID2&per_page=2
Unfortunately, this only returns the information for ID2 and the video ID before it in its channel, instead of for both IDs specified. I've also tried appending multiple containing_url fields to no avail. Is there any way to make this happen? I'm using axios in react native if that helps.
Instead of "containing_uri", use "uris" as documented here:
https://developer.vimeo.com/api/common-formats#batch-requests
https://developer.vimeo.com/api/reference/videos#GET/videos
The "containing_uri" parameter will only return the page of the specified uri. The "uris" parameter will return the specified videos/objects. Your request should look like this:
https://api.vimeo.com/users/XXXXXXXX/videos?fields=uri,duration,pictures.sizes.link,download&uris=/videos/ID1,/videos/ID2&per_page=2
I hope this information helps!

JMeter: Passing Key Value Pairs Not Working

I'm using JMeters to automate API testing to/from our database using basic CRUD methodology. After the record creation, I'm trying to perform 3 different types of Reads (think CRRRUD). :)
Read 1 - Retrieve by ID
HTTP (GET) the base URL is appended with the saved record ID.
http..../crud/tableName/${newRecordId}
This returns
Read 2 - Retrieve by field type with no defined value
HTTP (POST) the base URL is extended with a "search" as the end. A Key is defined ("name") with no value.
http..../crud/tableName/search
Parameter Name = name
Value = {undefined}
This returns all records within the table whose field ("name") is not null.
Read 3 - Retrieve by field type with a defined value
HTTP (POST) the base URL is extended with a "search" as the end. A Key is defined ("name") with the value generated during the creation request.
http..../crud/tableName/search
Parameter Name = name
Value = Metropolis
This, too, returns ALL of the records within the table instead of just the record(s) whose name = Metropolis.
This 3rd Retrieve works properly when using a REST client, (e.g., Postman, Advanced REST Client, etc.) when defining the Key|Value pair as "name|Metropolis". So it must be something within JMeter that I'm missing.
Any insight is appreciated!
There is only one correct answer: compare what's being sent by REST Client and JMeter using sniffer tool (i.e. Wireshark), detect the differences and configure JMeter accordingly.
Just a guess: given you mentioned "API" an "REST" words maybe you need to pass it as JSON like:
{"name":"Metropolis"}
as a single parameter value
or in formatted way (in case if server checks Content-Length and/or wants the request to be properly formatted)
You may also need to add HTTP Header Manager in order to send Content-Type header with the value of application/json. See Testing SOAP/REST Web Services Using JMeter guide for more details.

Ushahidi GET request with multiple parameters

I'm working on an application that uses Ushahidi to return an array of JSON objects using a HTTP GET request. I would like to use two parameters in the request. These parameters are category id and max id. In the URL below the first parameter is &by=catid&id=2 and the second is &by=maxid&id=499. The example below will only read the last parameter entered. So the catid parameter would be ignored.
http://fixyourstreet.ie/api?task=incidents&by=catid&id=2&by=maxid&id=499
Why will this request only return JSON objects by the last parameter entered rather than both parameters?
Any help would be much appreciated.
Those requests typically get parsed as key-value dictionaries by web servers.
This means the "by" parameter can only have one value when your request is processed and responded to. You will have to make 2 subsequent requests if you need all these values :
http://fixyourstreet.ie/api?task=incidents&by=catid&id=2
http://fixyourstreet.ie/api?task=incidents&by=maxid&id=499