Are there any websites/apps which are using the Mxit API outside of Mxit and how would this work?
Currently there are no websites/apps using the APIs outside of Mxit that we are aware of.
On the authorization side, it basically works the same way for the developer (ie, redirect to the MXit OAuth server with the requested scopes). If the request was from inside of MXit the user is prompted to only allow/deny the access; whereas for external requests the user will also be prompted to enter their MXit credentials in addition to allow/deny the access.
We will soon be supporting OpenID Connect for external websites/apps so they can securely verify which MXit user is accessing their service; and for users to support single-sign on using their MXit credentials.
How can I write a Javascript app that uses Mxit?
That OAuth API support is there to provide for Javascript client applications running in a web-browser outside of Mxit. eg, so browser-based / HTML5 apps can make use of the Mxit APIs.
For services accessed within the Mxit client you will need to output HTML conforming to the MobiPortal specification - so no client-side JavaScript. You could always write your server application in JavaScript, for example using Node.js, which output HTML for display on the client.
What should I do if I can’t see my test API contact on my Mxit client anymore? When I try to add it again, it says that this contact does not exist.
Just run your app with your test API key and wait a couple of hours. Then you'll be able to add it again.
I'm trying to push a message from a test application to a Mxit user, but the message never reaches me! How can I troubleshoot this?
- First check that the person you are sending the message to has added the app to their roster
- If the above has been done, have a look at the documentation on posting messages to a user using our Messaging API -http://dev.mxit.com/docs/api/messaging/post-message-send
- If you still encounter issues, send us the code you have written. Here is a good example:
So on the auth request my response is:
I then take the auth token and inject it in the header and submit the following message.<
Response
xmlns
=
"<a href="
https://auth.mxit.com/token">https://auth.mxit.com/token</
a
>">
<
access_token
>14cfc78f7ce741cfa39dae9f6c7c9401</
access_token
>
<
expires_in
>3600</
expires_in
>
<
scope
>message/send</
scope
>
<
token_type
>bearer</
token_type
>
</
Response
>
<
MessageToSend
xmlns
=
"<a href="
http://schemas.datacontract.org/2004/07/MXit.Spam">http://schemas.datacontract.org/2004/07/MXit.Spam</
a
>">
<
Body
>TestMessageClickatell</
Body
>
<
ContainsMarkup
>false</
ContainsMarkup
>
<
From
>clicktest</
From
>
<
To
>27829996633</
To
>
</
MessageToSend
>
In the example above, the message was submitted to the Mxit ID ('27829996633'), however a message is sent from the app to the user using the user’s UserID NOT his MxitID. Use the GET /user/lookup/{MxitId} call (which you will find in the User API docs here:http://dev.mxit.com/docs/api/user) to return the UserID from the MxitID.