Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Vlad Bukhanets
/
immoscout24-api-php
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Merge Requests
0
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
0668b320
authored
2020-08-10 09:38:09 +0200
by
fehrlich
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
minor format
1 parent
bf7ec52f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
src/ImmoScoutAPI.php
src/ImmoScoutAPI.php
View file @
0668b32
...
...
@@ -182,7 +182,7 @@ abstract class ImmoScoutAPI extends GuzzleClient
{
$domain
=
$this
->
getDomain
();
return
'https://rest.'
.
$domain
.
'/restapi/'
;
return
'https://rest.'
.
$domain
.
'/restapi/'
;
}
/**
...
...
@@ -266,7 +266,7 @@ abstract class ImmoScoutAPI extends GuzzleClient
throw
new
InvalidResponse
(
'Could not parse the requested request token'
);
}
$this
->
saveRequestToken
(
$body
[
'oauth_token'
],
$body
[
'oauth_token_secret'
]);
header
(
'Location: '
.
$this
->
getBaseUrl
()
.
'security/oauth/confirm_access?oauth_token='
.
$body
[
'oauth_token'
]);
header
(
'Location: '
.
$this
->
getBaseUrl
()
.
'security/oauth/confirm_access?oauth_token='
.
$body
[
'oauth_token'
]);
exit
();
}
...
...
@@ -369,7 +369,7 @@ abstract class ImmoScoutAPI extends GuzzleClient
}
$path
=
str_replace
(
'{user}'
,
$this
->
user
,
$path
);
return
$url
.
$path
;
return
$url
.
$path
;
}
/**
...
...
@@ -521,7 +521,7 @@ abstract class ImmoScoutAPI extends GuzzleClient
$msgs
=
$this
->
parseMessages
(
$res
);
if
(
!
isset
(
$msgs
[
'parsed'
][
$expectedResponse
]))
{
$code
=
isset
(
$msgs
[
'parsed'
][
'ERROR_RESOURCE_NOT_FOUND'
])
?
404
:
null
;
throw
new
InvalidResponse
(
'Did not get expected response: '
.
$res
->
getBody
(),
$code
,
null
,
$res
,
$msgs
);
throw
new
InvalidResponse
(
'Did not get expected response: '
.
$res
->
getBody
(),
$code
,
null
,
$res
,
$msgs
);
}
if
(
$expectedResponse
==
'MESSAGE_RESOURCE_CREATED'
)
{
return
$msgs
[
'parsed'
][
$expectedResponse
][
0
];
...
...
@@ -588,7 +588,7 @@ abstract class ImmoScoutAPI extends GuzzleClient
*/
public
function
updateRealEstate
(
$id
,
$obj
)
{
$res
=
$this
->
callUserMethod
(
'realestate/'
.
$id
.
'?usenewenergysourceenev2014values=true'
,
'PUT'
,
$obj
);
$res
=
$this
->
callUserMethod
(
'realestate/'
.
$id
.
'?usenewenergysourceenev2014values=true'
,
'PUT'
,
$obj
);
return
$this
->
checkForResponseUpdated
(
$res
);
}
...
...
@@ -603,7 +603,7 @@ abstract class ImmoScoutAPI extends GuzzleClient
*/
public
function
deleteAttachment
(
$reId
,
$attachmentId
)
{
$res
=
$this
->
callUserMethod
(
'realestate/'
.
$reId
.
'/attachment/'
.
$attachmentId
,
'DELETE'
);
$res
=
$this
->
callUserMethod
(
'realestate/'
.
$reId
.
'/attachment/'
.
$attachmentId
,
'DELETE'
);
return
$this
->
checkForResponseDeleted
(
$res
);
}
...
...
@@ -628,7 +628,7 @@ abstract class ImmoScoutAPI extends GuzzleClient
*/
public
function
createAttachment
(
$objId
,
$attachmentData
,
$content
,
$mimeType
=
'image/jpeg'
,
$fileName
=
'image.jpg'
)
{
$res
=
$this
->
callUserMethod
(
'realestate/'
.
$objId
.
'/attachment/'
,
'POST'
,
[
$res
=
$this
->
callUserMethod
(
'realestate/'
.
$objId
.
'/attachment/'
,
'POST'
,
[
'multipart'
=>
[
[
'Content-type'
=>
'application/json'
,
...
...
@@ -657,7 +657,7 @@ abstract class ImmoScoutAPI extends GuzzleClient
*/
public
function
createSimpleAttachment
(
$objId
,
$attachmentData
)
{
$res
=
$this
->
callUserMethod
(
'realestate/'
.
$objId
.
'/attachment/'
,
'POST'
,
$attachmentData
);
$res
=
$this
->
callUserMethod
(
'realestate/'
.
$objId
.
'/attachment/'
,
'POST'
,
$attachmentData
);
return
$this
->
checkForResponseCreated
(
$res
);
}
...
...
@@ -673,7 +673,7 @@ abstract class ImmoScoutAPI extends GuzzleClient
*/
public
function
updateAttachment
(
$objId
,
$id
,
$attachmentData
)
{
$res
=
$this
->
callUserMethod
(
'realestate/'
.
$objId
.
'/attachment/'
.
$id
,
'PUT'
,
$attachmentData
);
$res
=
$this
->
callUserMethod
(
'realestate/'
.
$objId
.
'/attachment/'
.
$id
,
'PUT'
,
$attachmentData
);
return
$this
->
checkForResponseUpdated
(
$res
);
}
...
...
@@ -688,7 +688,7 @@ abstract class ImmoScoutAPI extends GuzzleClient
*/
public
function
updateAttachmentOrder
(
$objId
,
$orderArray
)
{
$res
=
$this
->
callUserMethod
(
'realestate/'
.
$objId
.
'/attachment/attachmentsorder'
,
'PUT'
,
[
$res
=
$this
->
callUserMethod
(
'realestate/'
.
$objId
.
'/attachment/attachmentsorder'
,
'PUT'
,
[
'attachmentsorder.attachmentsorder'
=>
[
'@xmlns'
=>
[
'attachmentsorder'
=>
'http://rest.immobilienscout24.de/schema/attachmentsorder/1.0'
,
...
...
@@ -724,7 +724,7 @@ abstract class ImmoScoutAPI extends GuzzleClient
*/
public
function
delete
(
$reId
)
{
$res
=
$this
->
callUserMethod
(
'realestate/'
.
$reId
,
'DELETE'
);
$res
=
$this
->
callUserMethod
(
'realestate/'
.
$reId
,
'DELETE'
);
return
$this
->
checkForResponseDeleted
(
$res
);
}
...
...
@@ -759,7 +759,7 @@ abstract class ImmoScoutAPI extends GuzzleClient
*/
public
function
unpublish
(
$reId
,
$publishchannel
=
'10000'
)
{
$res
=
$this
->
callMethod
(
'publish/'
.
$reId
.
'_'
.
$publishchannel
,
'DELETE'
);
$res
=
$this
->
callMethod
(
'publish/'
.
$reId
.
'_'
.
$publishchannel
,
'DELETE'
);
return
$this
->
checkForResponseDeleted
(
$res
);
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment