why I get error from get request when i try to get last coins - swift

when I try to make get request with https://pro-api.coinmarketcap.com/v2/cryptocurrency/info?CMC_PRO_API_KEY=key.
I get an error msg - value must contain at least one of [id, symbol, slug, address]
But from what I understand I can get 100 in a straight.
I would love to understand where I am wrong, thanks.

Check the api docs: https://coinmarketcap.com/api/documentation/v1/#operation/getV2CryptocurrencyInfo
You simply need to add an additional query parameter ...info?CMC_PRO_API_KEY=key&id=1. You are not providing any information about what you want specific crypto info you want.

Related

FIXT1.1 ERROR_MISSING_EXECUTINGTRADER PartyRole

New Order Single(D)
Request-
FIXT.1.1:135->PSE, outgoing> (8=FIXT.1.19=14635=D34=449=SendercompId52=20191226-05:19:22.66156=TargetCompId11=157733756231838=10040=154=155=2GO59=060=20191226-13:19:22.645447=I448=135452=3453=010=253)
Response-
FIXT.1.1:135->PSE, incoming> (8=FIXT.1.19=00020535=849=SendercompId56=TargetCompId34=452=20191226-05:19:22.73537=NONE11=157733756231817=TE5368150=839=8103=9955=2GO54=138=10040=1151=014=060=20191226-05:19:22.73158=ERROR.MISSING_EXECUTINGTRADER PartyRole10=240)
ERROR.MISSING_EXECUTINGTRADER PartyRole
Kindly suggest with a proper example which gives correct response for New Order Single(D)
Kindly gives actual values related to parties
quickfix.fix50sp1.NewOrderSingle newOrderSingle = new quickfix.fix50sp1.NewOrderSingle(new ClOrdID(order.getID()),
sideToFIXSide(order.getSide()), new TransactTime(), typeToFIXType(order.getType()));
newOrderSingle.setField(new NoPartyIDs(?));
newOrderSingle.setField(new PartyRole(?));
newOrderSingle.setField(new PartyIDSource('?'));
newOrderSingle.setField(new PartyID("?"));
- List item
Fundamental part of the FIX protocol is the FIX dictionary, which is part of Rules of Engagement (RoE) between your system and the Execution Venue (aka Broker or Counterparty). It specifies what messages are part of the protocol and what fields are required on specific messages in specific scenarios, specifically, what fields are required on the New Order Single (35=D) message.
In your case, the text (tag 58) of the reject message, Execution Report (35=9|39=8) indicates that your application is not sending a mandatory tag PartyRole (452) on the request: 58=ERROR.MISSING_EXECUTINGTRADER PartyRole. But there will be more of them and you should really start from reading the Broker's ROE.
If you are just playing with FIX and coding both ends of the session yourself, check what fields are in use in the QuickFIXj Examples or in examples in my FIXGlue repository. It should get you going.

Unable to retrieve 'ContentId' property of Attachment in Office365 REST Api

I'm trying to retrieve attachments in the Office365 rest api. Since I want to avoid downloading the entire attachments, I'm using a select clause to avoid downloading the content, which is in the ContentBytes property:
$select="ContentId,ContentType,Id,IsInline,Name,Size"
So basically, I want to retrieve everything except the content. However, this gives the following error message (json):
{
"error":
{
"code": "RequestBroker-ParseUri",
"message": "Could not find a property named 'ContentId' on type 'Microsoft.OutlookServices.Attachment'."
}
}
It's telling me that ContentId doesn't exist, which contradicts the specifications.
Edit: Here is the full request:
GET /api/v2.0/me/messages/AAMkAGZlZjI3N2I3LTg1YWUtNDFiNC05MGI0LTVjYTVmZGI5NGI2YQBGAAAAAABzr8uDji9LRqgTCEsDv22wBwBWTXbvZW0dTKuxUGxpK4-lAAAAAAEMAABWTXbvZW0dTKuxUGxpK4-lAAC5QnKBAAA=/attachments?%24select=ContentId%2CContentType%2CId%2CIsInline%2CName%2CSize
Even more strange, when I do the same query without specifying any select clause, it returns me a full attachment object, including a ContentId.
Anybody can help?
In case anyone has the same question for microsoft graph, you need to pass this filter:
$select=microsoft.graph.fileAttachment/contentId
like this:
GET https://graph.microsoft.com/v1.0/me/messages/attachments?$select=microsoft.graph.fileAttachment/contentId
The request that you posted is getting the message specifications but not the attachments. Since you need to get the content id, you need to add /attachments to the request with any required parameters.
GET https://outlook.office.com/api/v2.0/me/messages/{message_id}/attachments/{attachment_id}
So please add the attachments to your query to be able to get the content id.
Hope this helps.
Solved it. The answer was suggested by Brian's comment and I found an additional hint here.
Since 'ContentId' is a property of a FileAttachment, you need to specify that in the request, like so:
$select="Microsoft.OutlookServices.FileAttachment/ContentId,ContentType,Id,IsInline,Name,Size"
That did the trick. Thanks for the suggestions.

Why does one HTTP GET request retrieve the required data and another retrieve []

I'm currently working on ng-admin.
I'm having a problem retrieving user data from my REST API (connected to a MongoDB) and displaying it.
I have identified the problem as the following:
When I enter http://localhost:3000/users into my browser, I get a list of all users in my database.
When I enter http://localhost:3000/users?_page=1&_perPage=30&_sortDir=DESC&_sortField=id,
I get [] as a result.
I am quite new to this, I used both my browser and the POSTMAN Chrome extension to test this and get the same result.
http://localhost:3000/users_end=30&_order=DESC&_sort=id&_start=0
This (/users_end) is a different request than /users.
It should be:
http://localhost:3000/users?end=30&_order=DESC&_sort=id&_start=0
Or, by looking at the other parameters:
http://localhost:3000/users?_end=30&_order=DESC&_sort=id&_start=0
with end or _end being the first parameter (mark the ?).
Update (it is ? and before the _, I have edited.):
If adding parameters to the request returns an empty list, try adding only one at a time to narrow down the problem (there's probably an error in the usage of those parameters - are you sure you need those underscores?).
Your REST API must have a way to handle pagination, sorting, and filtering. But ng-admin cannot determine exactly how, because REST is a style and not a standard. So ng-admin makes assumptions about how your API does that by default, that's why it adds these _end and _sort query parameters.
In order to transform these parameters into those that your API understands, you'll have to add an interceptor. This is all thoroughly explained in the ng-admin documentation: http://ng-admin-book.marmelab.com/doc/API-mapping.html

How to retrieve graph impressions with string action types

I am sending a request for graph insights with the action type breakdown like this one given in an example on Facebook page : https://graph.facebook.com/XXXXXXXX/app_insights/story_publishes?since=1418112000&until=1426748400&summary=true&breakdowns[0]=client&breakdowns[1]=action_type&breakdowns[2]=auth_state&date_format=U
The result is however difficult to read because the type of action is represented by a numeric value (uuid) like this: "action_type"=>"465905580137487", so I dont know what it relates to- checkin, share or photo upload. Also for different apps those uuids are also different. Does anyone know what call I need to make to get the action type names as strings? Thanks for help
You need to call this URL:
https://graph.facebook.com/{action_id}
where action_id is the value returned by action_type. You'll receive the action details on the response.

Facebook Graph API event-id/comments?since=2014-02-01&until=2014-02-10 , Date filter has no effect

I am trying to bring comments made on a particular event by targeting this URL: https://graph.facebook.com/1466384840257158/comments
I am passing the user_access_token
I have two comments at present on this event made on the same
day(2014-03-29)
Now I try to pass a date which should bring an empty data result/object
like this: https://graph.facebook.com/1466384840257158/comments?since=2011-01-01&until=2014-01-10
This request has no effect, it still shows me the two comment made
on the 29th
I have tried the same kind of date range on my user-id/feed and it
gave me an empty data object.
Finally i tried event-id/feed (before trying date filter) and it
gave me the following error
.
{
"error": {
"message": "An unexpected error has occurred. Please retry your request later.",
"type": "OAuthException",
"code": 2
}
}
Could you please guide me about date filter on that particular query (point4) or if you have any other idea to use date filter on comments made for an event.
Comments use Cursor-based Pagination, so you cannot use since or until on the comments endpoint (these parameters would work f.ex. for the feed endpoint).
To get the comments in a time range you have to fetch all comments from NOW to the start of the time range, f.ex. with https://graph.facebook.com/1466384840257158/comments?filter=stream&limit=1000+paging (the filter=stream will order the result with the timestamp).
USING SINCE UNTIL FOR COMMENTS on GROUP
If you want to use since and until for comments, it is not possible directly for a group. So, First you can apply it for status(feed) and then get the comments for that feed.
This works for me:
{group_id}/?fields=feed.since(08/25/2016).until(08/31/2016){from,comments{from,message}}
Why don't you try first to filter by notifications?... notifications allows you to add parameters like since. For example (using Facebook pages):
https://graph.facebook.com/PAGEID?fields=notifications.since(2015-3-31 00:00:00).limit(250).include_read(true)&{id,created_time,updated_time,unread,object,link}&access_token=ACCESSTOKEN
Once you got the json data, loop through data, get the ID and send a second request but this time using the PAGEID_POSTID edge. Something like this:
https://graph.facebook.com/PAGEID_POSTID/comments?fields=id,from{name,id},message,can_remove,created_time&limit=1000
Voahla!... there's no need to read every comment!...
Note 1: A Page access token is required, along with the manage_pages permission
Note 2: Use the parameter/field include_read to get all the notifications, even the already readed
Note 3: In the second request, use the parameter/field "filter=stream" to order the posts and get the comments made in the name of your page
Note 4: Don't forget to control the asynchronicity once you loop!
Note 5: Notifications duplicate posts, use an array to avoid to read more than one time the postUse the parameter/field include_read to get all the notifications, even the already readed
I do not know if it's too late. But, Yeah it works in the graph api version 3.3.
for example: if you wanna get comments on a post of a Facebook page you can do it like this:
You have to use page Access-token
The get Graph Request : post_id/comments?since=some_date