I have following structure names Discussion. I want to fetch the last message in a discussion by a user. I tried following incomplete Spring MongoDB query, could you please let me know how to fetch just one message (sorted by lastmodifieddate) per discussion or find the discussions where a user is the recipient of the last message in the conversation.
Aggregation aggr = newAggregation(
match(Criteria.where("participants").regex(Pattern.compile(userid))),
unwind("messages"),
match(new Criteria().orOperator(Criteria.where("messages.touserId").is(userid),Criteria.where("messages.fromuserId").is(userid))),
sort(Direction.DESC, "messages.lastModifiedDate"),
group("_id").push("messages").as("messages"),
project("_id","messages")
);
{
"_id": {
"$oid": "57c2d7c8e4b0bcf181b7db0a"
},
"_class": "xxxxx",
"participants": [
"56893b22e4b0e8d1c6a25783",
"56893bb6e4b0e8d1c6a25785",
"577c2f6ee4b09ccb44d14415"
],
"messages": [
{
"_id": {
"$oid": "57c2d7c8e4b0bcf181b7db08"
},
"fromuserId": "577c2f6ee4b09ccb44d14415",
"fromuser": "xxxx",
"touserId": "56893b22e4b0e8d1c6a25783",
"touser": "Bloreshop1",
"message": "Check Product Price",
"isMute": false,
"index": 1,
"createDate": {
"$date": "2016-08-28T12:23:36.037Z"
},
"lastModifiedDate": {
"$date": "2016-08-28T12:23:36.037Z"
},
"createdBy": "xxxx",
"lastModifiedBy": "xxxxx"
},
{
"_id": {
"$oid": "57c2d7c8e4b0bcf181b7db09"
},
"fromuserId": "577c2f6ee4b09ccb44d14415",
"fromuser": "xxxxxx",
"touserId": "56893bb6e4b0e8d1c6a25785",
"touser": "Bloreshop2",
"message": "Check Product Price",
"isMute": false,
"index": 2,
"createDate": {
"$date": "2016-08-28T12:23:36.302Z"
},
"lastModifiedDate": {
"$date": "2016-08-28T12:23:36.302Z"
},
"createdBy": "xxxxx",
"lastModifiedBy": "xxx"
}
],
"discussionTopic": "Check Product Price",
"messageCount": 2,
"createDate": {
"$date": "2016-08-28T12:23:36.318Z"
},
"lastModifiedDate": {
"$date": "2016-08-28T12:23:36.318Z"
},
"createdBy": "xxxx",
"lastModifiedBy": "xxxxx"
}
You are looking for $slice(aggregation). Current release 1.9.5 version doesn't support slice.
Aggregation aggr = newAggregation(
match(Criteria.where("participants").regex(Pattern.compile(userid))),
unwind("messages"),
match(new Criteria().orOperator(Criteria.where("messages.touserId").is(userid), Criteria.where("messages.fromuserId").is(userid))),
sort(Direction.DESC, "messages.lastModifiedDate"),
group("_id").push("messages").as("messages"),
project("_id").and("messages").project("slice", 1));
Unreleased Version (2.x) supports slice
Aggregation aggr = newAggregation(
match(Criteria.where("participants").regex(Pattern.compile(userid))),
unwind("messages"),
match(new Criteria().orOperator(Criteria.where("messages.touserId").is(userid), Criteria.where("messages.fromuserId").is(userid))),
sort(Direction.DESC, "messages.lastModifiedDate"),
group("_id").push("messages").as("messages"),
project("_id").and("messages").slice(1));
Related
I've developed a java application that uses an Atlas MongoDB Serverless DB.
This application performs an Aggregation query with the following steps:
$match
$project
$addFields
$sort
$facet
$project
When I perform a query thats returns a lot of results I'm obtaining this exception: QueryExceededMemoryLimitNoDiskUseAllowed.
I've tried to modify my code adding allowDiskUse: true in the aggregation, but didn't resolve the exception.
I've tried to replicate my aggregation pipeline in Atlas console and found that every think works fine until $facet step that returns
Reason: PlanExecutor error during aggregation :: caused by :: Sort exceeded memory limit of 33554432 bytes, but did not opt in to external sorting.
This is my $facet step:
{$facet: {
paginatedResults: [{ $skip: 0 }, { $limit: 50 }],
totalCount: [
{
$count: 'count'
}
]
}
}
As you can see I'm using it to paginate my query results.
Any suggestion to avoid this problem?
I was thinking about making two different query one for the results and one for total count, but I'm not sure this is the best solution.
EDIT: added query
db.vendor_search.aggregate(
{$match: {
$or: [
{'searchKeys.value': {$regex: "vendor"}},
{'searchKeys.value': {$regex: "test"}},
{'searchKeys.valueClean': {$regex: "vendor"}},
{'searchKeys.valueClean': {$regex: "test"}},
],
buyerId: 7
}},
{$project: {
companyId: 1,
buyerId: 1,
companyName: 1,
legalForm: 1,
country: 1,
supplhiCompanyCode: 1,
vat: 1,
erpCode: 1,
visibility: 1,
businessStatus: 1,
city: 1,
logo: 1,
location: {$concat : ["$country.value",'$city']},
searchKeys: {
"$filter": {
"input": "$searchKeys",
"cond": {
"$or": [
{$regexMatch: {input: "$$this.value",regex: "vendor"}},
{$regexMatch: {input: "$$this.value",regex: "test"}}
{$regexMatch: {input: "$$this.valueClean",regex: "vendor"}},
{$regexMatch: {input: "$$this.valueClean",regex: "test"}}
]
}
}
}
}},
{$addFields: {
searchMatching: {
$reduce: {
input: "$searchKeys.type",
initialValue: [],
in: {
$concatArrays: [
"$$value",
{$cond: [{$in: ["$$this", "$$value"]},[],["$$this"]]}
]
}
}
},
'sort.supplhiId': { $toLower: "$supplhiCompanyCode" },
'sort.companyName': { $toLower: "$companyName" },
'sort.location': { $toLower: {$concat : ["$country.value"," ","$city"]}},
'sort.vat': { $toLower: "$vat" },
'sort.companyStatus': { $toLower: "$businessStatus" },
'sort.erpCode': { $toLower: "$erpCode" }
}},
{$sort: {"sort.companyName": 1}},
{$facet: {
paginatedResults: [{ $skip: 0 }, { $limit: 50 }],
totalCount: [
{
$count: 'count'
}
]
}
},
{$project: {paginatedResults:1, 'totalCount': {$first : '$totalCount.count'}}}
)
EDIT: Added model
{
"buyerId": 1,
"companyId": 869048,
"address": "FP8R+52H",
"businessStatus": "AC",
"city": "Chiffa",
"companyName": "Test Algeria 25 agosto",
"country": {
"lookupId": 78,
"code": "DZA",
"value": "Algeria"
},
"erpCode": null,
"legalForm": "Ltd.",
"logo": "fc4d821a-e814-49e4-96d1-f32421fdaa6d_1.jpg",
"searchKeys": [
{
"type": "contact",
"value": "pebiw81522#xitudy.com",
"valueClean": "pebiw81522xitudycom"
},
{
"type": "company_registration_number",
"value": "112211331144",
"valueClean": "112211331144"
},
{
"type": "vendor_name",
"value": "test algeria 25 agosto ltd.",
"valueClean": "test algeria 25 agosto ltd"
},
{
"type": "contact",
"value": "tredicisf2#ottobre2022.com",
"valueClean": "tredicisf2ottobre2022com"
},
{
"type": "contact",
"value": "ty#s.com",
"valueClean": "tyscom"
},
{
"type": "contact",
"value": "info#x.com",
"valueClean": "infoxcom"
},
{
"type": "tin",
"value": "00112341675",
"valueClean": "00112341675"
},
{
"type": "contact",
"value": "hatikog381#rxcay.com",
"valueClean": "hatikog381rxcaycom"
},
{
"type": "supplhi_id",
"value": "100059410",
"valueClean": "100059410"
},
{
"type": "contact",
"value": "tredici#ottobre2022.com",
"valueClean": "trediciottobre2022com"
},
{
"type": "country_key",
"value": "00112341675",
"valueClean": "00112341675"
},
{
"type": "vat",
"value": "00112341675",
"valueClean": "00112341675"
},
{
"type": "address",
"value": "fp8r+52h",
"valueClean": "fp8r52h"
},
{
"type": "city",
"value": "chiffa",
"valueClean": "chiffa"
},
{
"type": "contact",
"value": "prova#supplhi.com",
"valueClean": "provasupplhicom"
},
{
"type": "contact",
"value": "saraxo2669#dmonies.com",
"valueClean": "saraxo2669dmoniescom"
}
],
"supplhiCompanyCode": "100059410",
"vat": "00112341675",
"visibility": true
}
in ATLAS M0 free clusters and M2/M5 shared clusters sort in memory limit is 32 MB. ( ref ) , this limit seems to apply also to serverless
For not limited mongod you may usually increase this limit from 32MB for example to 320MB as follow:
db.adminCommand({setParameter: 1, internalQueryExecMaxBlockingSortBytes: 335544320})
You can check the current value with:
db.runCommand( { getParameter : 1, "internalQueryExecMaxBlockingSortBytes" : 1 } )
But it is best to optimize your queries to not hit this limit , if you post your full query and indexes ( db.collection.getIndexes() perhaps there is a better way ...
I am trying to filter the records based on nested field and want only the matching object in that array to be shown as part of the record.
Below is the detailed explanation of my requirement.
So, I have Elasticsearch data like this:
[{
"basicInfo": {
"requestId": 123,
},
"managerInfo": {
"manager": "John",
},
"groupInfo": [
{
"id": "id1",
"name": "abc",
"status": "Approved"
},
{
"id": "id2",
"name": "abc",
"status": "Pending"
}
]
},
{
"basicInfo": {
"requestId": 233,
},
"managerInfo": {
"manager": "John Sr",
},
"groupInfo": [
{
"id": "id3",
"name": "abc",
"status": "Pending"
}
]
}
]
I want to filter the records only with groupInfo.status as Approved and basicInfo.requestId as 123, but my condition is I should only get the Approved record in the groupInfo and not the pending ones. So, the output I am expecting is:
{
"took": 23,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 3.0602708,
"hits": [
{
"_index": "my_index",
"_type": "request",
"_id": "123",
"_score": 3.0602708,
"_source": {
"basicInfo": {
"requestId": 123
},
"managerInfo": {
"manager": "John"
},
"groupInfo": [
{
"id": "id1",
"name": "abc",
"status": "Approved"
}
// No id2 here as it is in pending state
]
}
}
]
}
}
But instead I am able to achieve:
{
"took": 23,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 3.0602708,
"hits": [
{
"_index": "my_index",
"_type": "request",
"_id": "123",
"_score": 3.0602708,
"_source": {
"basicInfo": {
"requestId": 123
},
"managerInfo": {
"manager": "John"
},
"groupInfo": [
{
"id": "id1",
"name": "abc",
"status": "Approved"
},
{
"id": "id2",
"name": "abc",
"status": "Pending"
}
]
}
}
]
}
}
This is the query I am using:
{
"query": {
"bool": {
"must": [
{
"match": {
"basicInfo.requestId": "123"
}
},
{
"nested": {
"path": "groupInfo",
"query": {
"bool": {
"must": [
{
"term": {
"groupInfo.status": "Approved"
}
}
]
}
}
}
}
]
}
}
}
So, my question is first what I am expecting, is that even possible? Can we filter the result and make sure that we get only the matched array from that result?
If yes, how can we do it?
Thanks in advance.
Maybe you are looking for Inner Hits.
In many cases, it’s very useful to know which inner nested objects (in
the case of nested) or children/parent documents (in the case of
parent/child) caused certain information to be returned. The inner
hits feature can be used for this. This feature returns per search hit
in the search response additional nested hits that caused a search hit
to match in a different scope.
{
"query": {
"bool": {
"must": [
{
"match": {
"basicInfo.requestId": "123"
}
},
{
"nested": {
"path": "groupInfo",
"query": {
"bool": {
"must": [
{
"term": {
"groupInfo.status": "Approved"
}
}
]
}
},
"inner_hits":{}
}
}
]
}
}
}
I'm using the new Paypal Sync Api to get all transactions in a period of time. I need to be able to refund them too.
As all our transactions are always sales I need the sale ID to refund a transaction as stated in https://developer.paypal.com/docs/integration/direct/payments/refund-payments/#set-up-your-development-environment
Unfortunately I can not find anything in the transactions response which can be used as a sale ID
{
"transaction_details": [
{
"transaction_info": {
"paypal_account_id": "6EN7PS8P9DV6J",
"transaction_id": "05P62542TL3758730",
"transaction_event_code": "T0006",
"transaction_initiation_date": "2019-07-04T12:49:55+0000",
"transaction_updated_date": "2019-07-04T12:53:09+0000",
"transaction_amount": {
"currency_code": "USD",
"value": "10.00"
},
"fee_amount": {
"currency_code": "USD",
"value": "-0.49"
},
"transaction_status": "S",
"ending_balance": {
"currency_code": "USD",
"value": "0.00"
},
"available_balance": {
"currency_code": "USD",
"value": "0.00"
},
"protection_eligibility": "01"
},
"payer_info": {
"account_id": "6EN7PS8P9DV6J",
"email_address": "paypaltester3#test.de",
"address_status": "Y",
"payer_status": "Y",
"payer_name": {
"given_name": "Tester Three",
"surname": "Tester Three",
"alternate_full_name": "Tester Three Tester Three"
},
"country_code": "DE"
},
"shipping_info": {
"name": "Tester Three, Tester Three",
"address": {
"line1": "Teststreet. 1",
"city": "SomeCity",
"country_code": "DE",
"postal_code": "23434"
}
},
"cart_info": {
"item_details": [
{
"item_quantity": "1",
"item_unit_price": {
"currency_code": "USD",
"value": "10.00"
},
"item_amount": {
"currency_code": "USD",
"value": "10.00"
},
"total_item_amount": {
"currency_code": "USD",
"value": "10.00"
}
}
]
},
"store_info": {},
"auction_info": {},
"incentive_info": {}
}
],
"account_number": "96B45RCG6AX3E",
"start_date": "2019-07-03T00:00:00+0000",
"end_date": "2019-07-04T16:00:00+0000",
"last_refreshed_datetime": "2019-07-15T08:59:59+0000",
"page": 1,
"total_items": 15,
"total_pages": 1,
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/reporting/transactions?start_date=2019-07-03T00%3A00%3A00Z&end_date=2019-07-04T16%3A00%3A00Z&fields=all&page_size=500&page=1",
"rel": "self",
"method": "GET"
}
]
}
I tested a refund call with a transactionId and with an invoiceId but both returned "INTERNAL_SERVICE_ERROR".
Is there any way to get the sale ID by an API after the customer has completed the payment or do I have to save the sale ID in a database after creating a payment?
Thanks
With T0006 you are lucky, it is a simple PayPal Checkout APIs. transaction, it would be harder with T0002. Anyway, no the response have much more data. The example is below.
You can find it in invoice_number, or invoice_id. If only you had this data during payment creation procedures.
"transaction_details":[
{
"transaction_info":{
"paypal_account_id":"HHHHH",
"transaction_id":"040404040404040",
"transaction_event_code":"T0006",
"transaction_initiation_date":"2019-10-31T06:21:37+0000",
"transaction_updated_date":"2019-10-31T06:31:02+0000",
"transaction_amount":{
"currency_code":"AUD",
"value":"96.90"
},
"fee_amount":{
"currency_code":"AUD",
"value":"-4.08"
},
"shipping_amount":{
"currency_code":"AUD",
"value":"17.90"
},
"transaction_status":"S",
"transaction_subject":"Full License",
"ending_balance":{
"currency_code":"AUD",
"value":"92.82"
},
"available_balance":{
"currency_code":"AUD",
"value":"92.82"
},
"invoice_id":"1110-US1",
"protection_eligibility":"01"
},
"payer_info":{
"account_id":"HHHHH",
"email_address":"test#paypal.com",
"address_status":"Y",
"payer_status":"Y",
"payer_name":{
"given_name":"First",
"surname":"Last",
"alternate_full_name":"First Last"
},
"country_code":"GB"
},
"shipping_info":{
"name":"Shaun Smith",
"address":{
"line1":"123, Some Road",
"line2":"Shop 4",
"city":"Melbourne",
"country_code":"AU",
"postal_code":"3185"
}
},
"cart_info":{
"item_details":[
{
"item_name":"Full License",
"item_description":"Full License",
"item_quantity":"1",
"item_unit_price":{
"currency_code":"AUD",
"value":"79.00"
},
"item_amount":{
"currency_code":"AUD",
"value":"79.00"
},
"total_item_amount":{
"currency_code":"AUD",
"value":"79.00"
},
"invoice_number":"1110-US1"
}
]
},
"store_info":{
},
"auction_info":{
},
"incentive_info":{
}
},
I have a token restful service, which generates the following info when I use postman to hit it (GET).
{
"authorities": [
{
"id": 1,
"authority": "admin"
},
{
"id": 2,
"authority": "ROLE_USER"
}
],
"details": {
"remoteAddress": "0:0:0:0:0:0:0:1",
"sessionId": null,
"tokenValue": "7760e769-9b1e-4669-8b6d-85e51809934d",
"tokenType": "bearer",
"decodedDetails": null
},
"authenticated": true,
"userAuthentication": {
"authorities": [
{
"id": 1,
"authority": "admin"
},
{
"id": 2,
"authority": "ROLE_USER"
}
],
"details": {
"remoteAddress": "0:0:0:0:0:0:0:1",
"sessionId": null
},
"authenticated": true,
"principal": {
"id": 1,
"username": "sysadmin",
"password": "$2a$10$xm6.EOh8GrsnwRy91d2cueZPwvPojuExnYEGy1auFyzqYTtdlHvUe",
"accountNonExpired": true,
"accountNonLocked": true,
"credentialsNonExpired": true,
"enabled": true,
"authorities": [
{
"id": 1,
"authority": "admin"
},
{
"id": 2,
"authority": "ROLE_USER"
}
],
"userId": "1"
},
"credentials": null,
"name": "sysadmin"
},
"credentials": "",
"oauth2Request": {
"clientId": "movez",
"scope": [
"all"
],
"requestParameters": {
"grant_type": "refresh_token"
},
"resourceIds": [],
"authorities": [],
"approved": true,
"refresh": false,
"redirectUri": null,
"responseTypes": [],
"extensions": {},
"grantType": "refresh_token",
"refreshTokenRequest": null
},
"principal": {
"id": 1,
"username": "sysadmin",
"password": "$2a$10$xm6.EOh8GrsnwRy91d2cueZPwvPojuExnYEGy1auFyzqYTtdlHvUe",
"accountNonExpired": true,
"accountNonLocked": true,
"credentialsNonExpired": true,
"enabled": true,
"authorities": [
{
"id": 1,
"authority": "admin"
},
{
"id": 2,
"authority": "ROLE_USER"
}
],
"userId": "1"
},
"clientOnly": false,
"name": "sysadmin"
}
However, when I use RestTemplate exchange to make the api call, I get the following,
The problem here is
There are two layers "authorities", which doesn't match the structure in the Json.
If we go deep, we only have the authority "ROLE_USER", the "admin" is not retrieved.
My code is
Map auth = restTemplate.exchange(tokenVerifyUri, HttpMethod.GET, entity, Map.class).getBody();
It previously worked fine but have this trouble after I upgrade spring to 2.0 (not sure if it is related).
Please help. Thanks in advance.
UPDATE:
If I change Map.class to String.class in exchange function, I got the correct Json.
I am trying to implement REST API for Fortify Software Security Center using Java. I am able to obtain
1)token by using following url
http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/auth/obtain_token
response for above URL as below
{
"data": {
"token": "NDIxMjE0NjUtOGIwNy00ZjFiLWEzMTUtZjZkYTg0MWY1Zjgz",
"creationDate": "2016-09-14T05:49:34.000+0000",
"terminalDate": "2016-09-15T05:49:34.000+0000"
},
"responseCode": 200
}
and
2)get list of reports using following URL
http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/reports
response for above URL as below
{
"data": [
{
"note": "",
"_href": "http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/reports/17",
"formatDefaultText": "PDF",
"projects": [
{
"id": 16,
"name": "Project 1",
"versions": [
{
"id": 30,
"name": "1.0",
"developmentPhase": "New"
}
]
}
],
"authEntity": {
"id": 2,
"userName": "AAA",
"firstName": "AAA",
"lastName": "AAA"
},
"isPublished": false,
"format": "PDF",
"generationDate": "2016-08-03T10:56:46.000+0000",
"statusDefaultText": "Processing Complete",
"reportDefinitionId": null,
"type": "ISSUE",
"typeDefaultText": "Issue Reports",
"inputReportParameters": null,
"name": "Project 1",
"id": 17,
"status": "PROCESS_COMPLETE"
},
{
"note": "",
"_href": "http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/reports/22",
"formatDefaultText": "PDF",
"projects": [
{
"id": 16,
"name": "Project 2",
"versions": [
{
"id": 30,
"name": "1.0",
"developmentPhase": "New"
}
]
}
],
"authEntity": {
"id": 10,
"userName": "BBB",
"firstName": "BBB",
"lastName": "BBB"
},
"isPublished": false,
"format": "PDF",
"generationDate": "2016-08-24T13:45:30.000+0000",
"statusDefaultText": "Processing Complete",
"reportDefinitionId": null,
"type": "ISSUE",
"typeDefaultText": "Issue Reports",
"inputReportParameters": null,
"name": "Project 2",
"id": 22,
"status": "PROCESS_COMPLETE"
},
{
"note": "",
"_href": "http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/reports/41",
"formatDefaultText": "PDF",
"projects": [
{
"id": 2,
"name": "Project 3",
"versions": [
{
"id": 3,
"name": "1.0",
"developmentPhase": "Active Development"
}
]
}
],
"authEntity": {
"id": 10,
"userName": "CCC",
"firstName": "CCC",
"lastName": "CCC"
},
"isPublished": false,
"format": "PDF",
"generationDate": "2016-08-25T16:56:22.000+0000",
"statusDefaultText": "Processing Complete",
"reportDefinitionId": null,
"type": "ISSUE",
"typeDefaultText": "Issue Reports",
"inputReportParameters": null,
"name": "Project 3",
"id": 41,
"status": "PROCESS_COMPLETE"
},
{
"note": "",
"_href": "http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/reports/57",
"formatDefaultText": "XLS",
"projects": [
{
"id": 2,
"name": "Project 4",
"versions": [
{
"id": 3,
"name": "1.0",
"developmentPhase": "Active Development"
}
]
}
],
"authEntity": {
"id": 11,
"userName": "DDD",
"firstName": "DDD",
"lastName": "DDD"
},
"isPublished": false,
"format": "XLS",
"generationDate": "2016-09-09T15:46:22.000+0000",
"statusDefaultText": "Processing Complete",
"reportDefinitionId": null,
"type": "ISSUE",
"typeDefaultText": "Issue Reports",
"inputReportParameters": null,
"name": "Project 4",
"id": 57,
"status": "PROCESS_COMPLETE"
}
],
"count": 4,
"responseCode": 200,
"links": {
"last": {
"href": "http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/reports/?start=0"
},
"first": {
"href": "http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/reports/?start=0"
}
}
}
But I didn't find any end point URL to download the saved reports. Can you please help me to get the end point URL or provide reference API document for HP fortify Software Security Center.
I know this is kind of an old post but just ran into the issue myself and found the solution.
First you have to request a file token as a HTTPPost:
http://xxx.xxx.xxx.xxx:8080/ssc/api/v1/fileTokens
with:
{"fileTokenType": "REPORT_FILE"}
in the request body.
This will return a unique id that you will use to fetch your report.
Next you will make another get request like such:
http://xxx.xxx.xxx.xxx:8080/ssc/transfer/reportDownload.html?mat=[file_token]&id=[project_id]
you will replace the [file_token] with the token returned from the above post and [project_id] with the project you want to download the report for.
so for example:
http://xxx.xxx.xxx.xxx:8080/ssc/transfer/reportDownload.html?mat=7e8d912e-2432-6496-3232-709b05513bf2&id=1
This will return the binary data that you can then save to a file. The file type is specified in the report data as "format"