Command Status 0x00000011 with submit_multi for SMPP integration - smpp

Hi am integrating with Sybase Mobile 365 Services and I have gotten submit_sm and deliver_sm to work fine. I am trying to get submit_multi to work, but no matter what I try I get back a Command Status = 11. Does anyone have any thoughts as to what that command status means? Why I would get that? I have tried different service types and everything else I can think of... with no success.
Thanks,
Stephen

Command Status = 11 (ESME_RINVDSTADR) means "Invalid destination address".
This mean that probably the the dest_address field in your submit_multi request is wrong.
The dest_address field for submit_multi should be a list of destination address structures as defined in SMPP 3.4 Specification - chapter 4.5.1.1.
The number of destination addresses in the list is set in the number_of_dests field.
Additionally, you could also check that the dest_addr_ton (Type of Number) and dest_addr_npi (Numbering Plan Indicator) are correct for each destination address. For more details about this check out this link.

Related

Unable to POST NZ employee openingBalances to Xero?

I am attempting to create a single opening balances record against an existing employee but keep getting a 400 Bad Request response with this detail...
At least one NZ opening balance item is required in the request
I am following the instructions as per this documentation...
https://developer.xero.com/documentation/api/payrollnz/employeeopeningbalances#post-opening-balances
URL : {DestinationID} is properly replaced with the employee GUIDhttps://api.xero.com/payroll.xro/2.0/employees/{DestinationID}/openingBalances
JSON Body[{"periodEndDate":"2011-01-30T00:00:00","daysPaid":5.00,"unpaidWeeks":0.00,"grossEarnings":1442.31}]
The Xero forums and support is pretty unreliable so I'm posting here in the hopes for a better response.
After some trial and error using the API Explorer that Xero provides I was able to get it working using their example....
I eventually learned that daysPaid and unpaidWeeks must both be integer whole numbers or else it fails.... The error message provided is misleading but this resolves the problem.

Http status code when data not found in Database

I'm trying to understand which Http Status Code to use in the following use case
The user tries to do a GET on an endpoint with an input ID.
The requested data is not available in the database.
Should the service send back:
404 - Not Found
As the data is NOT FOUND in the database
400 - Bad Request
As the data in the input request is not valid or present in the db
200 - OK with null response
200 - OK with an error message
In this case we can use a standard error message, with a contract that spans across all the 200 OK responses (like below).
BaseResponse {
Errors [{
Message: "Data Not Found"
}],
Response: null
}
Which is the right (or standard) approach to follow?
Thanks in advance.
Which is the right (or standard) approach to follow?
If you are following the REST API Architecture, you should follow these guidelines:
400 The request could not be understood by the server due to incorrect syntax. The client SHOULD NOT repeat the request without modifications.
It means that you received a bad request data, like an ID in alphanumeric format when you want only numeric IDs. Typically it refers to bad input formats or security checks (like an input array with a maxLength)
404 The server can not find the requested resource.
The ID format is valid and you can't find the resource in the data source.
If you don't follow any standard architecture, you should define how you want to manage these cases and share your thought with the team and customers.
In many legacy applications, an HTTP status 200 with errors field is very common since very-old clients were not so good to manage errors.

Gerrit API - get CommitInfo with optional WEB_LINKS - query syntax

I would like to create a REST query for Gerrit that would return CommitInfo entity but with a optional field containing so-called WEB_LINKS, that is "links to the commit in external sites as a list of WebLinkInfo entities."
This is how the query looks for obtaining the 'standard' CommitIinfo request (works correct):
https://<GERRIT_HOST>/a/projects/<PROJECT_NAME>/commits/<COMMIT_SHA>
According to the documentation (
1. https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#commit-info
2. https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#commit-info
)
I've written this:
https://<GERRIT_HOST>/a/projects/<PROJECT_NAME>/commits/<COMMIT_SHA>/?o=CURRENT_COMMIT&o=WEB_LINKS but I am getting Er=400 Client Error...
Could you please provide the corrent syntax of the query? In advance, thank you!
To get the WEB_LINKS info, the correct would be to add "?links" at the end of the command but I think this feature isn't available in project "Get Commit" endpoint.
But...
I was able to get this information using the change "Get Commit" endpoint using:
https://<GERRIT_HOST>/a/changes/<CHANGE_ID>/revisions/<COMMIT_SHA>/commit?links
Like for example:
https://<GERRIT_HOST>/a/changes/71135/revisions/c0d5d23ea05bf6e2011b453f1ee8c47a4da60821/commit?links

Is there a way to send funds from a specific bitcoin address in a wallet?

The first result from Google gave me an answer from 2012 so I wondered if there was a better one than 'use armoury' now?
It's fine if I have to decode the raw transactions, I would be grateful if someone could take me through the steps.
Thanks in advance :)
I'll answer my own question,
It was unbelievably easy.
(from the debug console or command line)
listunspent
produces a/the list of unspent outputs at your disposal.
Make a note of the 'txid', 'vout' and 'scriptPubKey' of each output you wish to use.
Use the 'createrawtransaction' command followed by a list of dictionaries containing the txid's and vout's of the inputs you chose earlier followed by the addresses you wish to send them to (the send to addresses are in a single dictionary, not a list of dictionaries).
createrawtransaction [{"txid":txid,"vout":n},...] {address:amount,...}
If you don't want to send the outputs in total (you want some change for yourself) you will need to include an address that you control in your sending dictionary (from your wallet or somewhere else) since outputs cannot be partially spent, sorry.
To pay the mining fee simply leave some of the total output amount unaccounted for and bitcoin will use it as the mining fee by default (fee is 0.0001 at time of writing).
If all went well you should be given a hex string.
Use the 'signrawtransaction' command to check there are no errors by passing in your new hex string followed by a list of dictionaries with the txid's, vout's and scriptPubKeys we got at the very beginning of all this.
signrawtransaction <hex string> [{"txid":txid,"vout":n,"scriptPubKey":hex},...]
note: in newer versions of bitcoin the list of dictionaries is not required
If you got a new hex with "complete" : true after it then all went well and you can now use the 'sendrawtransaction' command followed by the even newer hex you were just given to broadcast your newly created transaction into the bitcoin network.
sendrawtransaction <new hex string>
If you managed to sign it successfully but get a "code":-22,"message":"TX rejected" error please see the footnote below.
Notice it only took four commands in total:
*get (listunspent)
*create (createrawtransaction)
*sign (signrawtransaction)
*send (sendrawtransaction)
Easy :)
FOOTNOTE:
Be aware if you designate an unusually large fee like 0.5btc (I tried this on the testnet) the network will reject your transaction when you try to broadcast it because it thinks you've made a mistake which I discovered whilst I was experimenting.
(This is also the case if you are trying to spend more BTC than you have available.)
In the end I set the fee to 0.001 and it worked fine, here is a link to my question regarding this situation.
Another possibility is with Electrum. Under the Addresses tab right-click on one with non-zero balance and select 'Spend from'.
You have to click View > Show Addresses if you do not have the Addresses tab.
from where you wanna send your BTC. All you need to fill the withdrawal address of bitcoins. You may send your BTC to Bitfinex with the same process:
Fill withdraw address
Fill amount to be sent.
Verify your payment.
Done.

Using Infinispan hotrod python client

I want to test how hotrod python client works. While testing i am facing an issue where i am not able to store any element whose message id in request header is 128. While checking the code of remotecache.py and init.py i found that HEADER_RES_FMT is set to ">BBBBB" for magic, msg_id, op_code, status and topology_mark. what i believe after going through documentation of hotrod protocol is, this format should be ">BLBBB" as datatype of message id vLong.
Also, i tried changing the format ">BLBBB", but then also it didn't work.
Any help will be appreciated.
Thanks,
Sonal
Looks like a bug in the client, already reported here: https://github.com/infinispan/python-client/issues/6
L won't work because the message id has a variable length (1 up to 9 bytes). I don't think struct.unpack can handle that, so the client should read the bytes one by one.